From 91493d8652dc461ab72e8e91535dbe598253ad8d Mon Sep 17 00:00:00 2001 From: elliott_c Date: Tue, 12 Jul 2005 13:37:26 +0000 Subject: ChangeLogTag: Tue Jul 12 08:33:05 2005 Chad Elliott --- TAO/tests/RTCORBA/common_args.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'TAO/tests/RTCORBA/common_args.cpp') diff --git a/TAO/tests/RTCORBA/common_args.cpp b/TAO/tests/RTCORBA/common_args.cpp index b80ca5720d0..3085aa72bcb 100644 --- a/TAO/tests/RTCORBA/common_args.cpp +++ b/TAO/tests/RTCORBA/common_args.cpp @@ -4,6 +4,7 @@ #include "ace/Array_Base.h" #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_math.h" +#include "ace/OS_NS_stdlib.h" typedef ACE_Array_Base ULong_Array; @@ -158,11 +159,16 @@ get_values (const char *test_type, char* working_string = string; for (CORBA::ULong i = 0; i < length; ++i) { - result = ::sscanf (working_string, - "%ul", - &values[i]); - if (result == 0 || result == EOF) - break; + // sscanf with "%ul" doesn't seem to work properly on HP-UX. So, + // we will use strtoul instead. + char* endptr = 0; + values[i] = ACE_OS::strtoul (working_string, &endptr, 10); + + if (endptr != working_string && endptr != 0 && *endptr != '\0') + { + result = 0; + break; + } working_string += ACE_OS::strlen (working_string); working_string += 1; -- cgit v1.2.1