Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Is utility.library/Stricmp() broken?

18 views
Skip to first unread message

John Veregge

unread,
Dec 25, 1992, 5:52:39 PM12/25/92
to
Is the AmigaDOS 2.04 utility.library/Stricmp() broken?

I used the following code fragment as the comparison
routine passed to qsort() (STDC lib). I interchanged
strcmp(), Stricmp(), and Strnicmp(). I opened the
utility.library, OpenLibrary( "utility.library", 37 ),
prior to calling qsort(). The below three columns
show the output of their respective sorts.

I am using Aztec C 5.2a on a 2000HD with DOS 2.04.

Does anyone know what is going on?

qsort_comparison( void * s1, void * s2 )
{
return (int) Stricmp( *(char**)s1, *(char**)s2 );
}

strcmp(s1,s2) Stricmp(s1,s2) Strnicmp(s1,s2,100)
============== ============== ==============
README sh.dbg amigaregex.c
amigaregex.c sh2 sh
amigaregex.doc sh1 test.out
amigaregex.o test.out makefile
makefile sh amigaregex.o
sh amigaregex.doc amigaregex.doc
sh.dbg README README
sh1 makefile sh1
sh2 amigaregex.o sh2
test.out amigaregex.c sh.dbg

____________________________________________

John R Veregge - jo...@pluto.jpl.nasa.gov

Randell Jesup

unread,
Dec 28, 1992, 3:34:14 PM12/28/92
to
jo...@pluto.Jpl.Nasa.Gov writes:
>Is the AmigaDOS 2.04 utility.library/Stricmp() broken?

Not that I know of...

>I am using Aztec C 5.2a on a 2000HD with DOS 2.04.

> qsort_comparison( void * s1, void * s2 )


> {
> return (int) Stricmp( *(char**)s1, *(char**)s2 );
> }

Are you certain that those void *'s are char **'s? Did you try it
with strcmp in the same place? Are you including clib/utility_protos.h?
Are you certain that your qsort wants <0, 0, or >0 for a return, and not
-1, 0, and 1?

--
To be or not to be = 0xff
-
Randell Jesup, Jack-of-quite-a-few-trades, Commodore Engineering.
{uunet|rutgers}!cbmvax!jesup, je...@cbmvax.cbm.commodore.com BIX: rjesup
Disclaimer: Nothing I say is anything other than my personal opinion.

John R Veregge

unread,
Dec 29, 1992, 12:20:57 AM12/29/92
to
In article <1992Dec25.2...@llyene.jpl.nasa.gov>, jo...@proteus.jpl.nasa.gov (John Veregge) writes:
|> Is the AmigaDOS 2.04 utility.library/Stricmp() broken?
|> ... (much drivel deleted)

|> ____________________________________________
|>
|> John R Veregge - jo...@pluto.jpl.nasa.gov

(Incidental music please... Elmer Fudd laughing will do {-; {-; {-;)

I always use the Aztec 5.2a C glue routines, instead of the pragma's,
when testing because it speeds up the builds. I tested Stricmp() using
the pragma's after I posted the aformentioned message. The pragma's
worked fine. The problem was not in the AmigaDOS routine Stricmp(),
but Aztec's 5.2a glue routine for it. Ummm, err, never mind...

I think I'll go back to the safer world of X11 development. {-; {-; {-;

0 new messages