libcsa: Warning prevention
authorPeter Howkins <flibble@users.sf.net>
Wed, 22 Aug 2012 10:53:08 +0000 (11:53 +0100)
committerPeter Howkins <flibble@users.sf.net>
Wed, 22 Aug 2012 10:53:08 +0000 (11:53 +0100)
Remove 'implicit declaration' warnings by included correct ANSI C headers.
Correct some format strings for long ints.

cde/lib/csa/convert4-5.c
cde/lib/csa/reparser.y

index 344c4a2ae0edb7fce0c84befe25c5ef3e39a342d..c7c0463b87c8f245204ea06e93e4c1b7a64312f2 100644 (file)
@@ -144,12 +144,12 @@ _DtCm_appt4_to_attrs(
                ptr2 = (ptr1 ? strchr(ptr1, '.') : NULL);
 
                if (ptr1) {
-                       snprintf(buf, sizeof buf, "%d:%s%s%s", a4->appt_id.key, calname,
+                       snprintf(buf, sizeof buf, "%ld:%s%s%s", a4->appt_id.key, calname,
                                (ptr2 == NULL ? "." : ""),
                                (ptr2 == NULL ? _DtCmGetLocalDomain(ptr1+1) :
                                ""));
                } else {
-                       snprintf(buf, sizeof buf, "%d:%s@%s", a4->appt_id.key, calname,
+                       snprintf(buf, sizeof buf, "%ld:%s@%s", a4->appt_id.key, calname,
                                _DtCmGetHostAtDomain());
                }
                opq.size = strlen(buf);
index 4c2a19a2d906bc55ed1f6687f1f11ab31adddf51..927af5438c6be785594bdb50563be483c22cf84a 100644 (file)
@@ -9,6 +9,8 @@
 
 #include <EUSCompat.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <ctype.h>
 #include <time.h>
 #include "rerule.h"