Skip to content

Commit 3938f8a

Browse files
committed
Replace sprint with sprintf.
1 parent 1531b7d commit 3938f8a

File tree

36 files changed

+191
-207
lines changed

36 files changed

+191
-207
lines changed

lang/basic/src/symbols.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ void heading(void)
256256
{
257257
char procname[50];
258258

259-
(void) sprint(procname,"_%s",fcn->symname);
259+
(void) sprintf(procname,"_%s",fcn->symname);
260260
C_pro_narg(procname);
261261
if ( fcn->symtype== DEFAULTTYPE)
262262
fcn->symtype= DOUBLETYPE;
@@ -348,7 +348,7 @@ int fcnend(int parmcount)
348348
error("not enough parameters");
349349
if ( parmcount >fcn->dimensions)
350350
error("too many parameters");
351-
(void) sprint(concatbuf,"_%s",fcn->symname);
351+
(void) sprintf(concatbuf,"_%s",fcn->symname);
352352
C_cal(concatbuf);
353353
C_asp((arith)fcnsize());
354354
C_lfr((arith) typestring(fcn->symtype));

lang/basic/src/util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ char *myitoa(int i)
7474
{
7575
static char buf[30];
7676

77-
sprint(buf,"%d",i);
77+
sprintf(buf,"%d",i);
7878
return(buf);
7979
}
8080

lang/cem/cemcom.ansi/dumpidf.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -324,37 +324,37 @@ static char *type2str(struct type *tp)
324324

325325
buf[0] = '\0';
326326
if (!tp) {
327-
sprint(buf, "<NILTYPE>");
327+
sprintf(buf, "<NILTYPE>");
328328
return buf;
329329
}
330-
sprint(buf, "%s(@%lx, #%ld, &%d) ",
330+
sprintf(buf, "%s(@%lx, #%ld, &%d) ",
331331
buf, tp, (long)tp->tp_size, tp->tp_align);
332332

333333
while (ops) {
334-
sprint(buf, "%s%s", buf, qual2str(tp->tp_typequal));
334+
sprintf(buf, "%s%s", buf, qual2str(tp->tp_typequal));
335335
switch (tp->tp_fund) {
336336
case POINTER:
337-
sprint(buf, "%spointer to ", buf);
337+
sprintf(buf, "%spointer to ", buf);
338338
break;
339339
case ARRAY:
340-
sprint(buf, "%sarray [%ld] of ", buf, tp->tp_size);
340+
sprintf(buf, "%sarray [%ld] of ", buf, tp->tp_size);
341341
break;
342342
case FUNCTION:
343-
sprint(buf, "%sfunction yielding ", buf);
343+
sprintf(buf, "%sfunction yielding ", buf);
344344
break;
345345
default:
346-
sprint(buf, "%s%s%s ", buf,
346+
sprintf(buf, "%s%s%s ", buf,
347347
tp->tp_unsigned ? "unsigned " : "",
348348
symbol2str(tp->tp_fund)
349349
);
350350
if (tp->tp_idf)
351-
sprint(buf, "%s %s ", buf,
351+
sprintf(buf, "%s %s ", buf,
352352
tp->tp_idf->id_text);
353353
#ifndef NOBITFIELD
354354
if (tp->tp_fund == FIELD && tp->tp_field) {
355355
struct field *fd = tp->tp_field;
356356

357-
sprint(buf, "%s [s=%ld,w=%ld] of ", buf,
357+
sprintf(buf, "%s [s=%ld,w=%ld] of ", buf,
358358
fd->fd_shift, fd->fd_width);
359359
}
360360
else
@@ -373,11 +373,11 @@ static char *qual2str(int qual)
373373

374374
*buf = '\0';
375375
if (qual == 0)
376-
sprint(buf, "(none)");
376+
sprintf(buf, "(none)");
377377
if (qual & TQ_CONST)
378-
sprint(buf, "%sconst ", buf);
378+
sprintf(buf, "%sconst ", buf);
379379
if (qual & TQ_VOLATILE)
380-
sprint(buf, "%svolatile ", buf);
380+
sprintf(buf, "%svolatile ", buf);
381381

382382
return qual == 0 ? "" : buf;
383383
}

lang/cem/cemcom.ansi/idf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ struct idf *gen_idf(void)
5353
static int name_cnt;
5454
char *s = malloc(strlen(dot.tk_file) + 50);
5555

56-
sprint(s, "#%d in %s, line %u", ++name_cnt, dot.tk_file, dot.tk_line);
56+
sprintf(s, "#%d in %s, line %u", ++name_cnt, dot.tk_file, dot.tk_line);
5757
s = realloc(s, strlen(s) + 1);
5858
return str2idf(s, 0);
5959
}

lang/cem/cemcom/arith.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ int2float(expp, tp)
281281
if (is_cp_cst(exp)) {
282282
*expp = new_expr();
283283
**expp = *exp;
284-
sprint(buf+1, "%ld", (long)(exp->VL_VALUE));
284+
sprintf(buf+1, "%ld", (long)(exp->VL_VALUE));
285285
buf[0] = '-';
286286
exp = *expp;
287287
exp->ex_type = tp;

lang/cem/cemcom/dumpidf.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -249,35 +249,35 @@ type2str(tp)
249249

250250
buf[0] = '\0';
251251
if (!tp) {
252-
sprint(buf, "<NILTYPE>");
252+
sprintf(buf, "<NILTYPE>");
253253
return buf;
254254
}
255255

256-
sprint(buf, "%s(#%ld, &%d) ", buf, (long)tp->tp_size, tp->tp_align);
256+
sprintf(buf, "%s(#%ld, &%d) ", buf, (long)tp->tp_size, tp->tp_align);
257257
while (ops) {
258258
switch (tp->tp_fund) {
259259
case POINTER:
260-
sprint(buf, "%spointer to ", buf);
260+
sprintf(buf, "%spointer to ", buf);
261261
break;
262262
case ARRAY:
263-
sprint(buf, "%sarray [%ld] of ", buf, tp->tp_size);
263+
sprintf(buf, "%sarray [%ld] of ", buf, tp->tp_size);
264264
break;
265265
case FUNCTION:
266-
sprint(buf, "%sfunction yielding ", buf);
266+
sprintf(buf, "%sfunction yielding ", buf);
267267
break;
268268
default:
269-
sprint(buf, "%s%s%s", buf,
269+
sprintf(buf, "%s%s%s", buf,
270270
tp->tp_unsigned ? "unsigned " : "",
271271
symbol2str(tp->tp_fund)
272272
);
273273
if (tp->tp_idf)
274-
sprint(buf, "%s %s", buf,
274+
sprintf(buf, "%s %s", buf,
275275
tp->tp_idf->id_text);
276276
#ifndef NOBITFIELD
277277
if (tp->tp_field) {
278278
struct field *fd = tp->tp_field;
279279

280-
sprint(buf, "%s [s=%ld,w=%ld] of ", buf,
280+
sprintf(buf, "%s [s=%ld,w=%ld] of ", buf,
281281
fd->fd_shift, fd->fd_width);
282282
}
283283
else

lang/cem/cemcom/idf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ gen_idf()
157157
struct idf *id;
158158
char *s = malloc(strlen(dot.tk_file)+50);
159159

160-
sprint(s, "#%d in %s, line %u",
160+
sprintf(s, "#%d in %s, line %u",
161161
++name_cnt, dot.tk_file, dot.tk_line);
162162
id = str2idf(s);
163163
free(s);

lang/cem/cpp.ansi/init.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ void init_pp(void)
7474
tp = localtime(&clock);
7575

7676
/* __DATE__ */
77-
sprint(dbuf, "\"%s %2d %d\"", months[tp->tm_mon],
77+
sprintf(dbuf, "\"%s %2d %d\"", months[tp->tm_mon],
7878
tp->tm_mday, tp->tm_year+1900);
7979
/* if (tp->tm_mday < 10) dbuf[5] = ' '; */ /* hack */
8080
macro_def(str2idf("__DATE__", 0), dbuf, -1, strlen(dbuf), NOUNDEF);
8181

8282
/* __TIME__ */
83-
sprint(tbuf, "\"%02d:%02d:%02d\"", tp->tm_hour, tp->tm_min, tp->tm_sec);
83+
sprintf(tbuf, "\"%02d:%02d:%02d\"", tp->tm_hour, tp->tm_min, tp->tm_sec);
8484
macro_def(str2idf("__TIME__", 0), tbuf, -1, strlen(tbuf), NOUNDEF);
8585

8686
/* __LINE__ */

lang/cem/cpp.ansi/preprocess.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ void preprocess(char *fn)
157157
*/
158158
char* p = Xbuf;
159159

160-
sprint(p, "%s 1 \"%s\"\n", LINE_PREFIX, FileName);
160+
sprintf(p, "%s 1 \"%s\"\n", LINE_PREFIX, FileName);
161161
while (*p)
162162
{
163163
echo(*p++);
@@ -172,7 +172,7 @@ void preprocess(char *fn)
172172
if (!options['P']) \
173173
{ \
174174
char* p = Xbuf; \
175-
sprint(Xbuf, "%s %d \"%s\"\n", LINE_PREFIX, (int)LineNumber, FileName); \
175+
sprintf(Xbuf, "%s %d \"%s\"\n", LINE_PREFIX, (int)LineNumber, FileName); \
176176
op--; \
177177
while (op >= _obuf && (class(*op) == STSKIP || *op == '\n')) \
178178
op--; \

lang/cem/lint/lpass2/l_print3ack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ print(format) char *format; { ; }
2222
/* FORMAT1 */
2323
fprint(filep, format) File *filep; char *format; { ; }
2424
/* FORMAT1 */
25-
sprint(s, format) char *s; char *format; { ; }
25+
sprintf(s, format) char *s; char *format; { ; }
2626
/* FORMAT1 */
2727
doprnt(filep, format) File *filep; char *format; { ; }
2828

0 commit comments

Comments
 (0)