diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-08-15 19:31:30 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-08-15 19:31:30 +0000 |
commit | cc7a78241f8535fd006a51951ab99b378bf37924 (patch) | |
tree | 3a2d5a9294885a688d256e4b11e4a9351066c6c5 /nuttx/lib/lib_strncasecmp.c | |
parent | ce2e2a11b0b2b403abdbcdc4bfb34b940560f002 (diff) | |
download | px4-nuttx-cc7a78241f8535fd006a51951ab99b378bf37924.tar.gz px4-nuttx-cc7a78241f8535fd006a51951ab99b378bf37924.tar.bz2 px4-nuttx-cc7a78241f8535fd006a51951ab99b378bf37924.zip |
Fix strcasecmp
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2019 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/lib/lib_strncasecmp.c')
-rw-r--r-- | nuttx/lib/lib_strncasecmp.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/nuttx/lib/lib_strncasecmp.c b/nuttx/lib/lib_strncasecmp.c index 11d499161..5b35bfff1 100644 --- a/nuttx/lib/lib_strncasecmp.c +++ b/nuttx/lib/lib_strncasecmp.c @@ -1,7 +1,7 @@ /**************************************************************************** * lib/lib_strncasecmp.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -57,10 +57,13 @@ int strncasecmp(const char *cs, const char *ct, size_t nb) register signed char result = 0; for (; nb > 0; nb--) { - if ((result = toupper(*cs) - toupper(*ct++)) != 0 || !*cs++) + if ((result = toupper(*cs) - toupper(*ct)) != 0 || !*cs) { break; } + + cs++; + ct++; } return result; } |