Chameleon

Chameleon Commit Details

Date:2016-05-21 15:56:31 (7 years 11 months ago)
Author:zenith432
Commit:2823
Parents: 2822
Message:print (null) for null string
Changes:
M/branches/zenith432/i386/libsa/prf.c

File differences

branches/zenith432/i386/libsa/prf.c
171171
172172
173173
174
174
175175
176176
177177
......
268268
269269
270270
271
272
273
274
271275
272276
273277
274
278
275279
276280
277281
278282
279283
280284
281
285
282286
283287
284288
(void)(*putfn_p)('x', putfn_arg);
}
width = 2;
minwidth = (minwidth >= 2) ? (minwidth - 2) : 0;
minwidth = ((minwidth >= 2) ? (minwidth - 2) : 0);
}
return width + printn((unsigned long long) p, 16, ZERO, minwidth, putfn_p, putfn_arg);
}
break;
case 's':
s = va_arg(ap, const char*);
if (!s)
{
s = "(null)";
}
width = 0;
if (!putfn_p)
{
while (s && (c = *s++))
while ((c = *s++))
{
width++;
}
len += ((width < minwidth) ? minwidth : width);
break;
}
while (s && (c = *s++))
while ((c = *s++))
{
(void)(*putfn_p)(c, putfn_arg);
len++;

Archive Download the corresponding diff file

Revision: 2823