From 4ffc7c4f20c400f9e09a980924a4e5698fa556fd Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Thu, 9 Feb 2012 22:57:13 +0100 Subject: [PATCH] strutils: reindent the file Signed-off-by: Sami Kerola --- lib/strutils.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/lib/strutils.c b/lib/strutils.c index 14d4de75..bfe2cd0b 100644 --- a/lib/strutils.c +++ b/lib/strutils.c @@ -15,15 +15,16 @@ long strtol_or_err(const char *str, const char *errmesg) long num; char *end = NULL; - if (str != NULL && *str != '\0') { - errno = 0; - num = strtol(str, &end, 10); - if (errno == 0 && str != end && end != NULL && *end == '\0') - return num; - } + if (str != NULL && *str != '\0') { + errno = 0; + num = strtol(str, &end, 10); + if (errno == 0 && str != end && end != NULL && *end == '\0') + return num; + } error(EXIT_FAILURE, errno, "%s: '%s'", errmesg, str); - return 0; + return 0; } + /* * same as strtod(3) but exit on failure instead of returning crap */ @@ -32,12 +33,12 @@ double strtod_or_err(const char *str, const char *errmesg) double num; char *end = NULL; - if (str != NULL && *str != '\0') { - errno = 0; - num = strtod(str, &end); - if (errno == 0 && str != end && end != NULL && *end == '\0') - return num; - } + if (str != NULL && *str != '\0') { + errno = 0; + num = strtod(str, &end); + if (errno == 0 && str != end && end != NULL && *end == '\0') + return num; + } error(EXIT_FAILURE, errno, "%s: '%s'", errmesg, str); return 0; } -- 2.40.0