Changeset: 0d314e6c6128 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0d314e6c6128
Modified Files:
        clients/mapiclient/eventparser.c
Branch: default
Log Message:

Define hardcoded constant


diffs (23 lines):

diff --git a/clients/mapiclient/eventparser.c b/clients/mapiclient/eventparser.c
--- a/clients/mapiclient/eventparser.c
+++ b/clients/mapiclient/eventparser.c
@@ -27,6 +27,8 @@ extern char *strptime(const char *, cons
 #include "strptime.c"
 #endif
 
+#define DATETIME_CHAR_LENGTH 27
+
 static void
 clearArguments(void)
 {
@@ -224,8 +226,8 @@ keyvalueparser(char *txt, EventRecord *e
 #else
                curr_time = *localtime(&sec);
 #endif
-               ev->time = malloc(26*sizeof(char));
-               snprintf(ev->time, 26, "%d/%02d/%02d %02d:%02d:%02d.%s",
+               ev->time = malloc(DATETIME_CHAR_LENGTH*sizeof(char));
+               snprintf(ev->time, DATETIME_CHAR_LENGTH, "%d/%02d/%02d 
%02d:%02d:%02d.%s",
                                 curr_time.tm_year + 1900, curr_time.tm_mon, 
curr_time.tm_mday,
                                 curr_time.tm_hour, curr_time.tm_min, 
curr_time.tm_sec,
                                 c);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to