summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikola Pajkovsky <npajkovs@redhat.com>2010-08-25 17:01:35 +0200
committerNikola Pajkovsky <npajkovs@redhat.com>2010-08-25 17:01:35 +0200
commit1e47744ff61a23f4b0e3a6ee04044e008681fad1 (patch)
tree040a24fae38093d5deaf43f37b67042d4a69c626
parente8121aed97cb6bd33e54f37148c40b16687d0918 (diff)
downloadabrt-1e47744ff61a23f4b0e3a6ee04044e008681fad1.tar.gz
abrt-1e47744ff61a23f4b0e3a6ee04044e008681fad1.tar.xz
abrt-1e47744ff61a23f4b0e3a6ee04044e008681fad1.zip
xatonum.cpp: fix indentation
Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
-rw-r--r--lib/utils/xatonum.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/lib/utils/xatonum.cpp b/lib/utils/xatonum.cpp
index 83146298..3b22071f 100644
--- a/lib/utils/xatonum.cpp
+++ b/lib/utils/xatonum.cpp
@@ -9,42 +9,42 @@
unsigned xatou(const char *numstr)
{
- unsigned long r;
- int old_errno;
- char *e;
-
- if (*numstr < '0' || *numstr > '9')
- goto inval;
-
- old_errno = errno;
- errno = 0;
- r = strtoul(numstr, &e, 10);
- if (errno || numstr == e || *e != '\0' || r > UINT_MAX)
- goto inval; /* error / no digits / illegal trailing chars */
- errno = old_errno; /* Ok. So restore errno. */
- return r;
-
- inval:
- error_msg_and_die("invalid number '%s'", numstr);
+ unsigned long r;
+ int old_errno;
+ char *e;
+
+ if (*numstr < '0' || *numstr > '9')
+ goto inval;
+
+ old_errno = errno;
+ errno = 0;
+ r = strtoul(numstr, &e, 10);
+ if (errno || numstr == e || *e != '\0' || r > UINT_MAX)
+ goto inval; /* error / no digits / illegal trailing chars */
+ errno = old_errno; /* Ok. So restore errno. */
+ return r;
+
+inval:
+ error_msg_and_die("invalid number '%s'", numstr);
}
int xatoi_u(const char *numstr)
{
- unsigned r = xatou(numstr);
- if (r > (unsigned)INT_MAX)
- error_msg_and_die("invalid number '%s'", numstr);
- return r;
+ unsigned r = xatou(numstr);
+ if (r > (unsigned)INT_MAX)
+ error_msg_and_die("invalid number '%s'", numstr);
+ return r;
}
int xatoi(const char *numstr)
{
- unsigned r;
+ unsigned r;
- if (*numstr != '-')
- return xatoi_u(numstr);
+ if (*numstr != '-')
+ return xatoi_u(numstr);
- r = xatou(numstr + 1);
- if (r > (unsigned)INT_MAX + 1)
- error_msg_and_die("invalid number '%s'", numstr);
- return - (int)r;
+ r = xatou(numstr + 1);
+ if (r > (unsigned)INT_MAX + 1)
+ error_msg_and_die("invalid number '%s'", numstr);
+ return - (int)r;
}