Patch by J Sisson: sprintf -> snprintf
[umurmur.git] / src / main.c
index 8c5febd6fb742b291c3d7e1e32ea9ac816ae1dc4..863a7d4dacfd2ca8e54b35bd3414ef12c7e092ab 100644 (file)
@@ -64,7 +64,7 @@ void lockfile(const char *pidfile)
        
        if (lfp < 0)
                Log_fatal("Cannot open PID-file %s for writing", pidfile);
-       sprintf(str,"%d\n", getpid());
+       snprintf(str,16,"%d\n", getpid());
        write(lfp, str, strlen(str)); /* record pid to lockfile */
        Log_info("PID-file: %s", pidfile);
 }