[LOG2LINES] Add a TODO, Use a snprintf()
authorSerge Gautherie <reactos-git_serge_171003@gautherie.fr>
Wed, 16 Jan 2019 16:46:27 +0000 (17:46 +0100)
committerMark Jansen <mark.jansen@reactos.org>
Sat, 16 Mar 2019 10:22:58 +0000 (11:22 +0100)
Addendum to c5d8d8d.

sdk/tools/log2lines/log2lines.c

index 4ee66bb..b5ff009 100644 (file)
@@ -637,6 +637,7 @@ main(int argc, const char **argv)
         char PathBuffer[LINESIZE + 1];
         char LineOutBuffer[LINESIZE + 1];
 
         char PathBuffer[LINESIZE + 1];
         char LineOutBuffer[LINESIZE + 1];
 
+        // TODO: Re-use one translate_files(), instead of repeated translate_line().
         while (i < argc)
         {
             offset = argv[optCount + i++];
         while (i < argc)
         {
             offset = argv[optCount + i++];
@@ -646,7 +647,7 @@ main(int argc, const char **argv)
                 {
                     l2l_dbg(2, "translating %s %s\n", exefile, offset);
 
                 {
                     l2l_dbg(2, "translating %s %s\n", exefile, offset);
 
-                    sprintf(Line, "<%s:%s>\n", exefile, offset);
+                    snprintf(Line, LINESIZE, "<%s:%s>\n", exefile, offset);
                     translate_line(conOut, Line, PathBuffer, LineOutBuffer);
                     report(conOut);
                 }
                     translate_line(conOut, Line, PathBuffer, LineOutBuffer);
                     report(conOut);
                 }