Make bcd2int work (resume time reporting now works.)
PR: 12613 Submitted by: Michael Constant <mconst@not.there.com>
This commit is contained in:
parent
94c8c4fb16
commit
e50479cc81
@ -15,7 +15,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"$Id: apm.c,v 1.14 1998/09/04 16:08:54 imp Exp $";
|
||||
"$Id: apm.c,v 1.15 1999/07/20 15:31:23 green Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/file.h>
|
||||
@ -72,13 +72,15 @@ int
|
||||
bcd2int(int bcd)
|
||||
{
|
||||
int retval = 0;
|
||||
int place = 1;
|
||||
|
||||
if (bcd > 0x9999)
|
||||
return -1;
|
||||
|
||||
while (bcd) {
|
||||
retval = retval * 10 + ((bcd & 0xf000) >> 12);
|
||||
bcd = (bcd & 0xfff) << 4;
|
||||
retval += (bcd & 0xf) * place;
|
||||
bcd >>= 4;
|
||||
place *= 10;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user