From 5042abe7ccac6d56f1512e38e2fa40f831a23138 Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Tue, 1 Feb 2000 14:14:29 +0000 Subject: [PATCH] changes for ToOctalString and ToHwxString --- src/libCom/cvtFast/cvtFast.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libCom/cvtFast/cvtFast.c b/src/libCom/cvtFast/cvtFast.c index aa3f511b1..6a9930e1b 100644 --- a/src/libCom/cvtFast/cvtFast.c +++ b/src/libCom/cvtFast/cvtFast.c @@ -441,7 +441,7 @@ int epicsShareAPI cvtLongToString( } if(source<0) { if(source == LONG_MIN) { - sprintf(pdest,"%ld",(long)LONG_MIN); + sprintf(pdest,"%ld",LONG_MIN); return((int)strlen(pdest)); } *pdest++ = '-'; @@ -511,12 +511,13 @@ int epicsShareAPI cvtLongToHexString( } if(source<0) { if(source == LONG_MIN) { - sprintf(pdest,"%lx",(long)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; @@ -547,12 +548,13 @@ int epicsShareAPI cvtLongToOctalString( } if(source<0) { if(source == LONG_MIN) { - sprintf(pdest,"%lo",(long)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;