This is the mail archive of the newlib-cvs@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin] Actually return value from __cp_index


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=8c6e4fec142b486531d2ac8da75250fa00a14e31

commit 8c6e4fec142b486531d2ac8da75250fa00a14e31
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Sat Oct 22 21:08:44 2016 +0200

    Actually return value from  __cp_index
    
    Fixes Coverty CID 153470
    
    Also drop redundant declaration of __cp_index.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 newlib/libc/ctype/ctype_cp.h     | 3 ---
 newlib/libc/stdlib/sb_charsets.c | 2 +-
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/newlib/libc/ctype/ctype_cp.h b/newlib/libc/ctype/ctype_cp.h
index 7ce0ab3..004c1e2 100644
--- a/newlib/libc/ctype/ctype_cp.h
+++ b/newlib/libc/ctype/ctype_cp.h
@@ -470,9 +470,6 @@
 	_L,	_L,	_L,	_L,	_L,	_L,	_L
 #define _CTYPE_PT154_255 _L
 
-
-extern int __cp_index (const char *charset_ext);
-
 #if defined(ALLOW_NEGATIVE_CTYPE_INDEX)
 
 #ifndef __CYGWIN__
diff --git a/newlib/libc/stdlib/sb_charsets.c b/newlib/libc/stdlib/sb_charsets.c
index 38583e5..961eb15 100644
--- a/newlib/libc/stdlib/sb_charsets.c
+++ b/newlib/libc/stdlib/sb_charsets.c
@@ -786,7 +786,7 @@ __cp_val_index (int val)
 int
 __cp_index (const char *charset_ext)
 {
-  int cp_idx = __cp_val_index (__micro_atoi (charset_ext));
+  return __cp_val_index (__micro_atoi (charset_ext));
 }
 
 #endif /* _MB_EXTENDED_CHARSETS_WINDOWS */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]