unsigned *dp;
char lineout[80];
- sprintf(lineout, "%d", year);
+ sprintf(lineout, "%u", year);
center(lineout,
(WEEK_LEN * 3 + HEAD_SEP * 2)
+ julian * (J_WEEK_LEN * 2 + HEAD_SEP
/* set array element to user string */
static void setari_u(var *a, int idx, const char *s)
{
- char sidx[sizeof(int)*3 + 1];
var *v;
- sprintf(sidx, "%d", idx);
- v = findvar(iamarray(a), sidx);
+ v = findvar(iamarray(a), itoa(idx));
setvar_u(v, s);
}
num = atoi(num_buf);
if (isdigit(num_buf[0]) && (num <= 100)) {
#if DEBUG
- char strVal[10];
- sprintf(strVal, "%d", num);
- DEBUG_MESSAGE(strVal);
+ DEBUG_MESSAGE(itoa(num));
#endif
fb_drawprogressbar(num);
}
int p;
const char *arg[4];
char exitcode[sizeof(int)*3 + 2];
- char sigcode[sizeof(int)*3 + 2];
if (s->state == S_FINISH) {
/* Two arguments are given to ./finish. The first one is ./run exit code,
arg[0] = "./finish";
arg[1] = "-1";
if (WIFEXITED(s->wstat)) {
- sprintf(exitcode, "%u", (int) WEXITSTATUS(s->wstat));
+ *utoa_to_buf(WEXITSTATUS(s->wstat), exitcode, sizeof(exitcode)) = '\0';
arg[1] = exitcode;
}
//arg[2] = "0";
//if (WIFSIGNALED(s->wstat)) {
- sprintf(sigcode, "%u", (int) WTERMSIG(s->wstat));
- arg[2] = sigcode;
+ arg[2] = utoa(WTERMSIG(s->wstat));
//}
arg[3] = NULL;
} else {
/* from var.c: */
{
char **envp;
- char ppid[sizeof(int)*3 + 2];
const char *p;
struct stat st1, st2;
}
}
- sprintf(ppid, "%u", (unsigned) getppid());
- setvar("PPID", ppid, 0);
+ setvar("PPID", utoa(getppid()), 0);
p = lookupvar("PWD");
if (p)