some fixes
This commit is contained in:
parent
f12358bfb0
commit
fbf67d7a29
|
@ -28,20 +28,20 @@ asctime(tm)
|
|||
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;
|
||||
|
|
|
@ -52,9 +52,9 @@ cvt(value, ndigit, decpt, sign, ecvtflag)
|
|||
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++;
|
||||
|
|
|
@ -4,7 +4,11 @@ static long seed = 1L;
|
|||
int rand()
|
||||
{
|
||||
seed = (1103515245L * seed + 12345) & 0x7FFFFFFF;
|
||||
return((int) ((seed >> 8) & 077777));
|
||||
#if EM_WSIZE == 4
|
||||
return (int) seed;
|
||||
#else
|
||||
return ((int)(seed >> 8) & 0x7FFF);
|
||||
#endif
|
||||
}
|
||||
|
||||
srand(n)
|
||||
|
|
Loading…
Reference in a new issue