From 7435a9831b5ec1beba03ff49f030e5fb9d3928e2 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 6 Mar 2012 14:14:39 -0600 Subject: [PATCH] db: Reject trailing space in numeric => enum/menu/device conversion This is really a workaround for a Win32/MinGW bug in sscanf, which will only set the %n argument for the format "%u %n" when there is a space following the unsigned number. This changes the IOC's behavior very slightly. --- src/db/dbConvert.c | 6 +++--- src/db/dbFastLinkConv.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/db/dbConvert.c b/src/db/dbConvert.c index 4b7ad7da1..d99cf7f33 100644 --- a/src/db/dbConvert.c +++ b/src/db/dbConvert.c @@ -2600,7 +2600,7 @@ static long putStringEnum( status = (*prset->get_enum_strs)(paddr,&enumStrs); if(!status) { nchoices = enumStrs.no_str; - nargs = sscanf(pbuffer," %u %n",&ind,&nchars); + nargs = sscanf(pbuffer,"%u%n",&ind,&nchars); if(nargs==1 && nchars==strlen(pbuffer) && indget_enum_strs)(paddr,&enumStrs); if(!status) { nchoices = enumStrs.no_str; - nargs = sscanf(from," %u %n",&ind,&nchars); + nargs = sscanf(from,"%u%n",&ind,&nchars); if(nargs==1 && nchars==strlen(from) && ind