Mercurial > hg > octave-jordi > gnulib-hg
comparison lib/uniconv/u8-conv-to-enc.c @ 11508:62fc220f4e95
Avoid test failures on AIX and OSF/1.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 26 Apr 2009 12:24:08 +0200 |
parents | ad8a75a45dc9 |
children | ef4e896a3b4f |
comparison
equal
deleted
inserted
replaced
11507:730480671c17 | 11508:62fc220f4e95 |
---|---|
1 /* Conversion from UTF-8 to legacy encodings. | 1 /* Conversion from UTF-8 to legacy encodings. |
2 Copyright (C) 2002, 2006-2007 Free Software Foundation, Inc. | 2 Copyright (C) 2002, 2006-2007, 2009 Free Software Foundation, Inc. |
3 | 3 |
4 This program is free software: you can redistribute it and/or modify it | 4 This program is free software: you can redistribute it and/or modify it |
5 under the terms of the GNU Lesser General Public License as published | 5 under the terms of the GNU Lesser General Public License as published |
6 by the Free Software Foundation; either version 3 of the License, or | 6 by the Free Software Foundation; either version 3 of the License, or |
7 (at your option) any later version. | 7 (at your option) any later version. |
48 return -1; | 48 return -1; |
49 } | 49 } |
50 #endif | 50 #endif |
51 | 51 |
52 /* Memory allocation. */ | 52 /* Memory allocation. */ |
53 if (*resultp != NULL && *lengthp >= srclen) | 53 if ((*resultp != NULL && *lengthp >= srclen) || srclen == 0) |
54 result = *resultp; | 54 result = *resultp; |
55 else | 55 else |
56 { | 56 { |
57 result = (char *) malloc (srclen); | 57 result = (char *) malloc (srclen); |
58 if (result == NULL) | 58 if (result == NULL) |