format string warnings, courtesy of Interix 3.5

This commit is contained in:
tg 2006-11-12 12:49:25 +00:00
parent 62d9cf9fa9
commit 5b525d79fb
2 changed files with 9 additions and 8 deletions

View File

@ -3,7 +3,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.33 2006/11/10 07:52:02 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.34 2006/11/12 12:49:25 tg Exp $");
#ifndef mksh_siglist
#if defined(BSD) || defined(__APPLE__)
@ -763,7 +763,7 @@ hist_shrink(unsigned char *oldbase, int oldbytes)
/*
* create temp file
*/
(void) shf_snprintf(nfile, sizeof(nfile), "%s.%d", hname, procpid);
shf_snprintf(nfile, sizeof(nfile), "%s.%d", hname, (int)procpid);
if ((fd = open(nfile, O_CREAT | O_TRUNC | O_WRONLY, 0600)) < 0)
return 1;
if (fstat(histfd, &statb) >= 0)

13
jobs.c
View File

@ -2,7 +2,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.14 2006/11/10 07:52:03 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.15 2006/11/12 12:49:25 tg Exp $");
/* Order important! */
#define PRUNNING 0
@ -1202,8 +1202,8 @@ j_print(Job *j, int how, struct shf *shf)
* group leader (ie, !FMONITOR). We arbitrarily return
* last pid (which is what $! returns).
*/
shf_fprintf(shf, "%d\n", j->pgrp ? j->pgrp :
(j->last_proc ? j->last_proc->pid : 0));
shf_fprintf(shf, "%d\n", (int)(j->pgrp ? j->pgrp :
(j->last_proc ? j->last_proc->pid : 0)));
return;
}
j->flags &= ~JF_CHANGED;
@ -1258,7 +1258,7 @@ j_print(Job *j, int how, struct shf *shf)
}
if (how == JP_LONG)
shf_fprintf(shf, "%5d ", p->pid);
shf_fprintf(shf, "%5d ", (int)p->pid);
if (how == JP_SHORT) {
if (buf[0]) {
@ -1278,8 +1278,9 @@ j_print(Job *j, int how, struct shf *shf)
p = p->next;
while (p && p->state == state && p->status == status) {
if (how == JP_LONG)
shf_fprintf(shf, "%s%5d %-20s %s%s", filler, p->pid,
space, p->command, p->next ? "|" : null);
shf_fprintf(shf, "%s%5d %-20s %s%s", filler,
(int)p->pid, space, p->command,
p->next ? "|" : null);
else if (how == JP_MEDIUM)
shf_fprintf(shf, " %s%s", p->command,
p->next ? "|" : null);