Properly use format strings
authorJoey Schulze <joey@infodrom.org>
Mon, 18 Sep 2006 09:56:13 +0000 (09:56 +0000)
committerJoey Schulze <joey@infodrom.org>
Mon, 18 Sep 2006 09:56:13 +0000 (09:56 +0000)
syslog_tst.c

index ca78601..56e2d81 100644 (file)
@@ -42,7 +42,7 @@ int main(int argc, char *argv[])
                                        if ( (nl = strrchr(bufr, '\n')) != \
                                            (char *) 0)
                                                *nl = '\0';
-                                       syslog(LOG_INFO, bufr);
+                                       syslog(LOG_INFO, "%s", bufr);
                                        logged += strlen(bufr);
                                        if ( logged > 1024 )
                                        {
@@ -54,7 +54,7 @@ int main(int argc, char *argv[])
                }
                else
                        while (argc-- > 1)
-                               syslog(LOG_INFO, argv++[1]);
+                               syslog(LOG_INFO, "%s", argv++[1]);
        }
        else
        {