Enlightenment CVS committal
Author : rephorm
Project : e17
Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore_config
Modified Files:
edb.c
Log Message:
use static buf's and snprintf
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_config/edb.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- edb.c 6 Feb 2004 18:48:55 -0000 1.8
+++ edb.c 13 Feb 2004 17:07:45 -0000 1.9
@@ -4,19 +4,18 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <limits.h>
int ecore_config_load(void) {
- char* file = malloc(1024); /* ### fixme */
- sprintf(file,"%s/.e/apps/%s/config.db",getenv("HOME"),__app_name);
+ char file[PATH_MAX];
+ snprintf(file, PATH_MAX, "%s/.e/apps/%s/config.db",getenv("HOME"),__app_name);
return ecore_config_load_file(file);
- free(file);
}
int ecore_config_save(void) {
- char* file = malloc(1024); /* ### fixme */
- sprintf(file,"%s/.e/apps/%s/config.db",getenv("HOME"),__app_name);
+ char file[PATH_MAX];
+ snprintf(file, PATH_MAX, "%s/.e/apps/%s/config.db",getenv("HOME"),__app_name);
return ecore_config_save_file(file);
- free(file);
}
int ecore_config_load_file(char *file) {
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs