Always return a string from telephony_error_to_str.
authorAndrzej Zaborowski <andrew.zaborowski@intel.com>
Mon, 12 Oct 2009 20:39:47 +0000 (22:39 +0200)
committerDenis Kenzior <denkenz@gmail.com>
Fri, 16 Oct 2009 16:14:02 +0000 (11:14 -0500)
So that it can be used as a printf argument directly.

src/common.c

index 1b002bf..cb79334 100644 (file)
@@ -280,14 +280,14 @@ const char *telephony_error_to_str(const struct ofono_error *error)
                maxentries = sizeof(ceer_errors) / sizeof(struct error_entry);
                break;
        default:
-               return 0;
+               return "Unknown error type";
        }
 
        for (i = 0; i < maxentries; i++)
                if (e[i].error == error->error)
                        return e[i].str;
 
-       return 0;
+       return "Unknown error";
 }
 
 int mmi_service_code_to_bearer_class(int code)