projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rename stdio_.h to stdio.in.h.
[gnulib.git]
/
lib
/
striconv.c
diff --git
a/lib/striconv.c
b/lib/striconv.c
index
b2490a7
..
ea4fa29
100644
(file)
--- a/
lib/striconv.c
+++ b/
lib/striconv.c
@@
-31,7
+31,6
@@
# include <limits.h>
#endif
# include <limits.h>
#endif
-#include "strdup.h"
#include "c-strcase.h"
#ifndef SIZE_MAX
#include "c-strcase.h"
#ifndef SIZE_MAX
@@
-397,8
+396,14
@@
str_cd_iconv (const char *src, iconv_t cd)
char *
str_iconv (const char *src, const char *from_codeset, const char *to_codeset)
{
char *
str_iconv (const char *src, const char *from_codeset, const char *to_codeset)
{
- if (c_strcasecmp (from_codeset, to_codeset) == 0)
- return strdup (src);
+ if (*src == '\0' || c_strcasecmp (from_codeset, to_codeset) == 0)
+ {
+ char *result = strdup (src);
+
+ if (result == NULL)
+ errno = ENOMEM;
+ return result;
+ }
else
{
#if HAVE_ICONV
else
{
#if HAVE_ICONV