Enlightenment CVS committal
Author : cedric
Project : e17
Module : libs/eet
Dir : e17/libs/eet/src/lib
Modified Files:
Eet_private.h eet_data.c eet_utils.c
Log Message:
Remove use of sprintf by propagating the buffer size information.
===================================================================
RCS file: /cvs/e/e17/libs/eet/src/lib/Eet_private.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -3 -r1.24 -r1.25
--- Eet_private.h 28 Mar 2008 17:17:43 -0000 1.24
+++ Eet_private.h 19 May 2008 15:27:04 -0000 1.25
@@ -68,7 +68,7 @@
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
===================================================================
RCS file: /cvs/e/e17/libs/eet/src/lib/eet_data.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -3 -r1.81 -r1.82
--- eet_data.c 19 May 2008 15:25:46 -0000 1.81
+++ eet_data.c 19 May 2008 15:27:04 -0000 1.82
@@ -513,7 +513,7 @@
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));
===================================================================
RCS file: /cvs/e/e17/libs/eet/src/lib/eet_utils.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- eet_utils.c 3 Apr 2008 19:30:18 -0000 1.8
+++ eet_utils.c 19 May 2008 15:27:04 -0000 1.9
@@ -150,7 +150,7 @@
/* */
/* 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 @@
else
*(des++) = '+';
- sprintf(des, "%d", p);
+ snprintf(des, 128, "%d", p);
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs