[LOG2LINES] Add a TODO, Use a snprintf()
[reactos.git] / sdk / tools / log2lines / log2lines.c
index 7213781..b5ff009 100644 (file)
@@ -634,22 +634,21 @@ main(int argc, const char **argv)
         const char *exefile = NULL;
         const char *offset = NULL;
         char Line[LINESIZE + 1];
+        char PathBuffer[LINESIZE + 1];
+        char LineOutBuffer[LINESIZE + 1];
 
+        // TODO: Re-use one translate_files(), instead of repeated translate_line().
         while (i < argc)
         {
-            Line[0] = '\0';
             offset = argv[optCount + i++];
             if (isOffset(offset))
             {
                 if (exefile)
                 {
                     l2l_dbg(2, "translating %s %s\n", exefile, offset);
-                    printf("<%s:%s", exefile, offset);
-                    if (!translate_file(exefile, my_atoi(offset), Line))
-                    {
-                        printf(" (%s)", Line);
-                    }
-                    printf(">\n");
+
+                    snprintf(Line, LINESIZE, "<%s:%s>\n", exefile, offset);
+                    translate_line(conOut, Line, PathBuffer, LineOutBuffer);
                     report(conOut);
                 }
                 else