25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: dec_prom.c,v 1.58 2005/05/15 01:55:49 debug Exp $ |
* $Id: dec_prom.c,v 1.60 2005/06/26 11:36:28 debug Exp $ |
29 |
* |
* |
30 |
* DECstation PROM emulation. |
* DECstation PROM emulation. |
31 |
*/ |
*/ |
363 |
|
|
364 |
switch (ch) { |
switch (ch) { |
365 |
case '%': |
case '%': |
366 |
strcpy(printfbuf, "%%"); |
strlcpy(printfbuf, "%%", |
367 |
|
sizeof(printfbuf)); |
368 |
break; |
break; |
369 |
case 'c': |
case 'c': |
370 |
case 'd': |
case 'd': |
376 |
/* Linux booters seem to go |
/* Linux booters seem to go |
377 |
over the edge sometimes: */ |
over the edge sometimes: */ |
378 |
ch = '\0'; |
ch = '\0'; |
379 |
strcpy(printfbuf, "[...]\n"); |
strlcpy(printfbuf, "[...]\n", |
380 |
|
sizeof(printfbuf)); |
381 |
#else |
#else |
382 |
printf("[ decstation_prom_emul" |
printf("[ decstation_prom_emul" |
383 |
"(): too many arguments ]"); |
"(): too many arguments ]"); |
393 |
|
|
394 |
switch (ch) { |
switch (ch) { |
395 |
case 'c': |
case 'c': |
396 |
sprintf(printfbuf, "%c", ch2); |
snprintf(printfbuf, sizeof( |
397 |
|
printfbuf), "%c", ch2); |
398 |
break; |
break; |
399 |
case 'd': |
case 'd': |
400 |
sprintf(printfbuf, "%d", |
snprintf(printfbuf, sizeof( |
401 |
argdata); |
printfbuf), "%d", argdata); |
402 |
break; |
break; |
403 |
case 'x': |
case 'x': |
404 |
sprintf(printfbuf, "%x", |
snprintf(printfbuf, sizeof( |
405 |
argdata); |
printfbuf), "%x", argdata); |
406 |
break; |
break; |
407 |
case 's': |
case 's': |
408 |
/* Print a "%s" string. */ |
/* Print a "%s" string. */ |
435 |
case '\0': |
case '\0': |
436 |
break; |
break; |
437 |
default: |
default: |
438 |
sprintf(printfbuf, "%c", ch); |
snprintf(printfbuf, sizeof(printfbuf), |
439 |
|
"%c", ch); |
440 |
} |
} |
441 |
|
|
442 |
printfbuf[sizeof(printfbuf)-1] = '\0'; |
printfbuf[sizeof(printfbuf)-1] = '\0'; |