mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-09 13:29:59 -05:00
minor modernizations
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1550 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
8e4660a0b5
commit
c7df4ba6c3
1 changed files with 5 additions and 6 deletions
|
|
@ -50,7 +50,6 @@
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
@ -60,6 +59,8 @@
|
||||||
#include <iconv.h>
|
#include <iconv.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <pulsecore/macro.h>
|
||||||
|
|
||||||
#include "utf8.h"
|
#include "utf8.h"
|
||||||
#include "xmalloc.h"
|
#include "xmalloc.h"
|
||||||
|
|
||||||
|
|
@ -207,9 +208,8 @@ static char* iconv_simple(const char *str, const char *to, const char *from) {
|
||||||
|
|
||||||
inlen = len = strlen(str) + 1;
|
inlen = len = strlen(str) + 1;
|
||||||
new_str = pa_xmalloc(len);
|
new_str = pa_xmalloc(len);
|
||||||
assert(new_str);
|
|
||||||
|
|
||||||
while (1) {
|
for (;;) {
|
||||||
inbuf = (ICONV_CONST char*) str; /* Brain dead prototype for iconv() */
|
inbuf = (ICONV_CONST char*) str; /* Brain dead prototype for iconv() */
|
||||||
inbytes = inlen;
|
inbytes = inlen;
|
||||||
outbuf = new_str;
|
outbuf = new_str;
|
||||||
|
|
@ -226,11 +226,10 @@ static char* iconv_simple(const char *str, const char *to, const char *from) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(inbytes != 0);
|
pa_assert(inbytes != 0);
|
||||||
|
|
||||||
len += inbytes;
|
len += inbytes;
|
||||||
new_str = pa_xrealloc(new_str, len);
|
new_str = pa_xrealloc(new_str, len);
|
||||||
assert(new_str);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
iconv_close(cd);
|
iconv_close(cd);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue