cvtLongToHexString now puts 0x in frount of the number and cvtLongToOctalString writes a leading 0.

This commit is contained in:
Marty Kraimer
2000-02-18 13:43:52 +00:00
parent 9e67db7af0
commit cac8d1f5bf
+4 -2
View File
@@ -514,12 +514,13 @@ int epicsShareAPI cvtLongToHexString(
}
if(source<0) {
if(source == LONG_MIN) {
sprintf(pdest,"%lx",LONG_MIN);
sprintf(pdest,"-0x%lx",LONG_MIN);
return((int)strlen(pdest));
}
*pdest++ = '-';
source = -source;
}
*pdest++ = '0'; *pdest++ = 'x';
val = source;
for(i=0; val!=0; i++) {
temp = val/16;
@@ -550,12 +551,13 @@ int epicsShareAPI cvtLongToOctalString(
}
if(source<0) {
if(source == LONG_MIN) {
sprintf(pdest,"%lo",LONG_MIN);
sprintf(pdest,"-0%lo",LONG_MIN);
return((int)strlen(pdest));
}
*pdest++ = '-';
source = -source;
}
*pdest++ = '0';
val = source;
for(i=0; val!=0; i++) {
temp = val/8;