--- a/nanohttp/nanohttp-logging.c
+++ b/nanohttp/nanohttp-logging.c
@@ -134,7 +134,7 @@ _log_write(log_level_t level, const char
     vsprintf(buffer2, buffer, ap);
     if (!log_background)
     {
-      printf(buffer2);
+      printf("%s", buffer2);
       fflush(stdout);
     }
 
@@ -145,7 +145,7 @@ _log_write(log_level_t level, const char
         f = fopen(hlog_get_file(), "w");
       if (f)
       {
-        fprintf(f, buffer2);
+        fprintf(f, "%s", buffer2);
         fflush(f);
         fclose(f);
       }
