Remove use of sprintf by propagating the buffer size information.

SVN revision: 34618
This commit is contained in:
Cedric BAIL 2008-05-19 15:27:04 +00:00
parent 09e1b5d7da
commit 4b23e38e3e
3 changed files with 4 additions and 4 deletions

View File

@ -68,7 +68,7 @@ void _eet_memfile_write_close(FILE *f);
void _eet_memfile_shutdown(void);
int _eet_hash_gen(const char *key, int hash_size);
int _eet_string_to_double_convert(const char *src, long long *m, long *e);
void _eet_double_to_string_convert(char *des, double d);
void _eet_double_to_string_convert(char des[128], double d);
#ifndef PATH_MAX
#define PATH_MAX 4096

View File

@ -513,7 +513,7 @@ eet_data_get_float(const Eet_Dictionary *ed, const void *src, const void *src_en
static void *
eet_data_put_float(Eet_Dictionary *ed, const void *src, int *size_ret)
{
char buf[64];
char buf[128];
int index;
_eet_double_to_string_convert(buf, (double)(*(float *)src));

View File

@ -150,7 +150,7 @@ _eet_string_to_double_convert(const char *src, long long *m, long *e)
/* */
/* where h is a hexadecimal number and e a decimal number. */
void
_eet_double_to_string_convert(char *des, double d)
_eet_double_to_string_convert(char des[128], double d)
{
static const char look_up_table[] = {'0', '1', '2', '3', '4',
'5', '6', '7', '8', '9',
@ -199,5 +199,5 @@ _eet_double_to_string_convert(char *des, double d)
else
*(des++) = '+';
sprintf(des, "%d", p);
snprintf(des, 128, "%d", p);
}