This fixes 5 potential bugs where the conditional would always be true.
git-svn-id: https://svn.musicpd.org/mpd/trunk@4659 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
54a1a9f2b6
commit
aa487e6c75
@ -122,7 +122,7 @@ char *convStrDup(char *string)
|
||||
iconv(char_conv_iconv, &string, &inleft, &bufferPtr,
|
||||
&outleft);
|
||||
if (outleft == BUFFER_SIZE
|
||||
|| (err < 0 && errno != E2BIG)) {
|
||||
|| (err == -1L && errno != E2BIG)) {
|
||||
free(ret);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ ogg_stream_type ogg_stream_type_detect(InputStream * inStream)
|
||||
|
||||
while (to_read) {
|
||||
r = readFromInputStream(inStream, buf, 1, to_read);
|
||||
if (r < 0)
|
||||
if (r < inStream->error)
|
||||
break;
|
||||
to_read -= r;
|
||||
if (!r && !inputStreamAtEOF(inStream))
|
||||
|
@ -239,7 +239,7 @@ static float getAacFloatTotalTime(char *file)
|
||||
unsigned int sampleRate;
|
||||
unsigned char channels;
|
||||
InputStream inStream;
|
||||
size_t bread;
|
||||
long bread;
|
||||
|
||||
if (openInputStream(&inStream, file) < 0)
|
||||
return -1;
|
||||
@ -291,7 +291,7 @@ static int aac_decode(OutputBuffer * cb, DecoderControl * dc, char *path)
|
||||
faacDecHandle decoder;
|
||||
faacDecFrameInfo frameInfo;
|
||||
faacDecConfigurationPtr config;
|
||||
size_t bread;
|
||||
long bread;
|
||||
unsigned int sampleRate;
|
||||
unsigned char channels;
|
||||
int eof = 0;
|
||||
|
@ -36,7 +36,7 @@
|
||||
static void blockingWrite(const int fd, const char *string, size_t len)
|
||||
{
|
||||
while (len) {
|
||||
size_t ret = xwrite(fd, string, len);
|
||||
ssize_t ret = xwrite(fd, string, len);
|
||||
if (ret == len)
|
||||
return;
|
||||
if (ret >= 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user