Skip to content

Commit

Permalink
Avoid uninitialized var
Browse files Browse the repository at this point in the history
Complained by coverity
  • Loading branch information
zsx committed Sep 24, 2014
1 parent ba507bc commit 70c7c3a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/s-unicode.c
Original file line number Diff line number Diff line change
Expand Up @@ -940,8 +940,7 @@ ConversionResult ConvertUTF8toUTF32 (
return NULL;
}
}

if (utf == 0 || utf == 8) {
else if (utf == 0 || utf == 8) {
size = Decode_UTF8((REBUNI*)Reset_Buffer(ser, len), bp, len, TRUE);
}
else if (utf == -16 || utf == 16) {
Expand All @@ -950,6 +949,9 @@ ConversionResult ConvertUTF8toUTF32 (
// else if (utf == -32 || utf == 32) {
// size = Decode_UTF32((REBUNI*)Reset_Buffer(ser, len/4 + 1), bp, len, utf < 0, TRUE);
// }
else {
return NULL; /* should never be here */
}

if (size < 0) {
size = -size;
Expand Down

0 comments on commit 70c7c3a

Please sign in to comment.