sgwdynspeed: no need to report regcomp error strings
authorFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 6 Jun 2012 15:05:19 +0000 (17:05 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 7 Jun 2012 22:29:39 +0000 (00:29 +0200)
When they fail, there is a programming error.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/sgwdynspeed/src/speedFile.c

index 24b2eb9..8a45395 100644 (file)
@@ -89,25 +89,17 @@ static bool readUL(const char * valueName, const char * value, unsigned long * v
  * @return true upon success, false otherwise
  */
 bool startSpeedFile(void) {
-       int result;
-
        if (started) {
                return true;
        }
 
-       result = regcomp(&regexComment, regexCommentString, REG_EXTENDED | REG_ICASE);
-       if (result) {
-               char msgbuf[256];
-               regerror(result, &regexComment, msgbuf, sizeof(msgbuf));
-               sgwDynSpeedError(false, "Could not compile regex \"%s\": %s", regexCommentString, msgbuf);
+       if (regcomp(&regexComment, regexCommentString, REG_EXTENDED | REG_ICASE)) {
+               sgwDynSpeedError(false, "Could not compile regex \"%s\"", regexCommentString);
                return false;
        }
 
-       result = regcomp(&regexNameValue, regexNameValueString, REG_EXTENDED | REG_ICASE);
-       if (result) {
-               char msgbuf[256];
-               regerror(result, &regexNameValue, msgbuf, sizeof(msgbuf));
-               sgwDynSpeedError(false, "Could not compile regex \"%s\": %s", regexNameValueString, msgbuf);
+       if (regcomp(&regexNameValue, regexNameValueString, REG_EXTENDED | REG_ICASE)) {
+               sgwDynSpeedError(false, "Could not compile regex \"%s\"", regexNameValueString);
                regfree(&regexComment);
                return false;
        }