cmenu: pad help filename with 0 instead of spaces
authorPierre-Alexandre Meyer <pierre@mouraf.org>
Mon, 7 Sep 2009 18:00:34 +0000 (11:00 -0700)
committerPierre-Alexandre Meyer <pierre@mouraf.org>
Mon, 7 Sep 2009 18:00:34 +0000 (11:00 -0700)
The manual states that the help filename format is hlp<NNNNN>.txt where
<NNNNN> is the helpid.

If the helpid contains less than 5 digits, pad with zero, not spaces,
i.e. look for hlp00023.txt, not hlp   23.txt.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
com32/cmenu/libmenu/help.c

index 0ec4e44..0df1e10 100644 (file)
@@ -215,7 +215,7 @@ void runhelpsystem(unsigned int helpid)
 {
     char filename[15];
 
-    sprintf(filename, "hlp%5d.txt", helpid);
+    sprintf(filename, "hlp%05d.txt", helpid);
     runhelp(filename);
 }