]> Devoid-pointer.net GitWeb - libHPCS.git/commitdiff
Fix possibly unitialized "ret"
authorMichal Malý <madcatxster@devoid-pointer.net>
Tue, 1 Dec 2015 17:03:49 +0000 (18:03 +0100)
committerMichal Malý <madcatxster@devoid-pointer.net>
Tue, 1 Dec 2015 17:03:49 +0000 (18:03 +0100)
libhpcs.c

index f17eda59a5a5155c8de24c4bce88c19e71638f45..9df05b6e681bc9e8d1d601f3ceb43ed1003ca70e 100644 (file)
--- a/libhpcs.c
+++ b/libhpcs.c
@@ -135,8 +135,10 @@ enum HPCS_RetCode hpcs_read_mdata(const char* filename, struct HPCS_MeasuredData
        }
 
        pret = read_file_type_description(datafile, &mdata->file_description);
-       if (pret != PARSE_OK)
+       if (pret != PARSE_OK) {
+               ret = HPCS_E_PARSE_ERROR;
                goto out;
+       }
 
        if (!file_type_description_is_readable(mdata->file_description)) {
                PR_DEBUGF("Incompatible file description: %s\n", mdata->file_description);
@@ -217,8 +219,10 @@ enum HPCS_RetCode hpcs_read_mheader(const char* filename, struct HPCS_MeasuredDa
        }
 
        pret = read_file_type_description(datafile, &mdata->file_description);
-       if (pret != PARSE_OK)
+       if (pret != PARSE_OK) {
+               ret = HPCS_E_PARSE_ERROR;
                goto out;
+       }
 
        if (!file_type_description_is_readable(mdata->file_description)) {
                PR_DEBUGF("Incompatible file description: %s\n", mdata->file_description);