Added format string to fprintf().

This commit is contained in:
Thomas Doerfler
2009-11-30 13:24:59 +00:00
parent 42836e3f85
commit 8bca4fcaa4
2 changed files with 7 additions and 3 deletions

View File

@@ -34,6 +34,10 @@
* libcsupport/src/termios.c: Obtain output semaphore before drain * libcsupport/src/termios.c: Obtain output semaphore before drain
output during close to prevent an infinite output drain loop. output during close to prevent an infinite output drain loop.
2009-11-30 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libmisc/shell/shell.c: Added format string to fprintf().
2009-11-30 Sebastian Huber <sebastian.huber@embedded-brains.de> 2009-11-30 Sebastian Huber <sebastian.huber@embedded-brains.de>
* rtems/include/rtems/rtems/timer.h: Added timer server control block * rtems/include/rtems/rtems/timer.h: Added timer server control block

View File

@@ -162,7 +162,7 @@ int rtems_shell_line_editor(
{ {
case RTEMS_SHELL_KEYS_END: case RTEMS_SHELL_KEYS_END:
if (output) if (output)
fprintf(out,line + col); fprintf(out, "%s", line + col);
col = (int) strlen (line); col = (int) strlen (line);
break; break;
@@ -278,7 +278,7 @@ int rtems_shell_line_editor(
case 5:/*Control-e*/ case 5:/*Control-e*/
if (output) if (output)
fprintf(out,line + col); fprintf(out, "%s", line + col);
col = (int) strlen (line); col = (int) strlen (line);
break; break;
@@ -364,7 +364,7 @@ int rtems_shell_line_editor(
for (ch = end + 1; ch > col; ch--) for (ch = end + 1; ch > col; ch--)
line[ch] = line[ch - 1]; line[ch] = line[ch - 1];
if (output) { if (output) {
fprintf(out, line + col); fprintf(out, "%s", line + col);
for (bs = 0; bs < (end - col + 1); bs++) for (bs = 0; bs < (end - col + 1); bs++)
fputc('\b', out); fputc('\b', out);
} }