]> granicus.if.org Git - xz/commitdiff
xz: Make sure that message_strm() can never return NULL.
authorLasse Collin <lasse.collin@tukaani.org>
Thu, 21 Oct 2010 20:16:11 +0000 (23:16 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Thu, 21 Oct 2010 20:16:11 +0000 (23:16 +0300)
src/xz/message.c

index c73099e6b7f9eebbb79e6691700e1cecf1633041..38cce4a1b0fde15aba28548db0ffefe5db7428e4 100644 (file)
@@ -833,10 +833,13 @@ message_strm(lzma_ret code)
        case LZMA_STREAM_END:
        case LZMA_GET_CHECK:
        case LZMA_PROG_ERROR:
-               return _("Internal error (bug)");
+               // Without "default", compiler will warn if new constants
+               // are added to lzma_ret, it is not too easy to forget to
+               // add the new constants to this function.
+               break;
        }
 
-       return NULL;
+       return _("Internal error (bug)");
 }