summaryrefslogtreecommitdiffstats
path: root/text-utils/hexdump-parse.c
diff options
context:
space:
mode:
authorOndrej Oprala2013-11-08 17:13:13 +0100
committerKarel Zak2013-12-02 13:44:24 +0100
commit1be6ed6adea4ba45c478d4ff40469ed6b62ee090 (patch)
treea34733fdb369cd4ab1d7e4abaae6798e9df6ad69 /text-utils/hexdump-parse.c
parenthexdump: rename struct _fs to struct hexdump_fs and remove its typedef (diff)
downloadkernel-qcow2-util-linux-1be6ed6adea4ba45c478d4ff40469ed6b62ee090.tar.gz
kernel-qcow2-util-linux-1be6ed6adea4ba45c478d4ff40469ed6b62ee090.tar.xz
kernel-qcow2-util-linux-1be6ed6adea4ba45c478d4ff40469ed6b62ee090.zip
hexdump: add __attribute__ ((__noreturn__)) to bad*() functions
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Diffstat (limited to 'text-utils/hexdump-parse.c')
-rw-r--r--text-utils/hexdump-parse.c44
1 files changed, 20 insertions, 24 deletions
diff --git a/text-utils/hexdump-parse.c b/text-utils/hexdump-parse.c
index 291c620f9..ed94bb839 100644
--- a/text-utils/hexdump-parse.c
+++ b/text-utils/hexdump-parse.c
@@ -47,10 +47,26 @@
#include "strutils.h"
static void escape(char *p1);
-static void badcnt(const char *s);
-static void badsfmt(void);
-static void badfmt(const char *fmt);
-static void badconv(const char *ch);
+
+static void __attribute__ ((__noreturn__)) badcnt(const char *s)
+{
+ errx(EXIT_FAILURE, _("bad byte count for conversion character %s"), s);
+}
+
+static void __attribute__ ((__noreturn__)) badsfmt(void)
+{
+ errx(EXIT_FAILURE, _("%%s requires a precision or a byte count"));
+}
+
+static void __attribute__ ((__noreturn__)) badfmt(const char *fmt)
+{
+ errx(EXIT_FAILURE, _("bad format {%s}"), fmt);
+}
+
+static void __attribute__ ((__noreturn__)) badconv(const char *ch)
+{
+ errx(EXIT_FAILURE, _("bad conversion character %%%s"), ch);
+}
#define first_letter(s,f) strchr(f, *(s))
@@ -474,23 +490,3 @@ static void escape(char *p1)
++p1; ++p2;
}
}
-
-static void badcnt(const char *s)
-{
- errx(EXIT_FAILURE, _("bad byte count for conversion character %s"), s);
-}
-
-static void badsfmt(void)
-{
- errx(EXIT_FAILURE, _("%%s requires a precision or a byte count"));
-}
-
-static void badfmt(const char *fmt)
-{
- errx(EXIT_FAILURE, _("bad format {%s}"), fmt);
-}
-
-static void badconv(const char *ch)
-{
- errx(EXIT_FAILURE, _("bad conversion character %%%s"), ch);
-}