[Pkg-e-commits] [SCM] Enlightenment DR17 file chunk reading/writing library branch, upstream-vcs, updated. a69a05397f2e0ea58ef72d66be1b9700c8b707cf
cedric
cedric at alioth.debian.org
Tue May 20 11:47:58 UTC 2008
The following commit has been merged in the upstream-vcs branch:
commit 3ffee11e92ce54f2d7b8a5358167651454359605
Author: cedric <cedric>
Date: Mon May 19 15:27:04 2008 +0000
Remove use of sprintf by propagating the buffer size information.
diff --git a/src/lib/Eet_private.h b/src/lib/Eet_private.h
index 2638c5b..a2c2e13 100644
--- a/src/lib/Eet_private.h
+++ b/src/lib/Eet_private.h
@@ -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
diff --git a/src/lib/eet_data.c b/src/lib/eet_data.c
index 6a96172..9026f84 100644
--- a/src/lib/eet_data.c
+++ b/src/lib/eet_data.c
@@ -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));
diff --git a/src/lib/eet_utils.c b/src/lib/eet_utils.c
index 8ae5d94..1785076 100644
--- a/src/lib/eet_utils.c
+++ b/src/lib/eet_utils.c
@@ -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);
}
--
Enlightenment DR17 file chunk reading/writing library
More information about the Pkg-e-commits
mailing list