pb = two_digits(
two_digits(
two_digits(
- two_digits(pb, tm->tm_mday),
- tm->tm_hour),
- tm->tm_min),
- tm->tm_sec);
+ two_digits(pb, tm->tm_mday, 0),
+ tm->tm_hour, 1),
+ tm->tm_min, 1),
+ tm->tm_sec, 1);
four_digits(pb, tm->tm_year+1900);
return(buf);
}
static char *
-two_digits(pb, i)
+two_digits(pb, i, nospace)
register char *pb;
{
*pb = (i / 10) % 10 + '0';
- if (*pb == '0') *pb = ' ';
+ if (!nospace && *pb == '0') *pb = ' ';
pb++;
*pb++ = (i % 10) + '0';
return ++pb;
the conversion to "int" truncates
*/
if (pe >= &buf1[NDIGITS]) {
- pb = &buf1[NDIGITS-10];
- while (pb > buf1) *--pb = *--pe;
- pe = &buf[NDIGITS-10];
+ pb = &buf1[10];
+ pe = &buf1[0];
+ while (pb < &buf1[NDIGITS]) *pe++ = *pb++;
}
*pe++ = (int)((value+.05) * 10) + '0';
pointpos++;