diff options
author | Thomas Graf <tgraf@suug.ch> | 2013-02-28 12:07:04 (GMT) |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2013-02-28 12:07:04 (GMT) |
commit | 4d7680c19c131175e2ec431de9a026230c968a7e (patch) | |
tree | f124f02b933d6e88e8f53047a1cf05df377281af /src | |
parent | ded20487fd631f7fcfc8f3cc547f6a8852501b83 (diff) | |
download | libnl-4d7680c19c131175e2ec431de9a026230c968a7e.zip libnl-4d7680c19c131175e2ec431de9a026230c968a7e.tar.gz libnl-4d7680c19c131175e2ec431de9a026230c968a7e.tar.bz2 |
Use thread-safe strerror_r() instead of strerror()
We have only ever fed well known error codes into strerror()
so it should never have been a problem though.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/utils.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/utils.c b/src/lib/utils.c index 78ad260..e5eacde 100644 --- a/src/lib/utils.c +++ b/src/lib/utils.c @@ -70,6 +70,7 @@ void nl_cli_print_version(void) void nl_cli_fatal(int err, const char *fmt, ...) { va_list ap; + char buf[256]; fprintf(stderr, "Error: "); @@ -79,7 +80,7 @@ void nl_cli_fatal(int err, const char *fmt, ...) va_end(ap); fprintf(stderr, "\n"); } else - fprintf(stderr, "%s\n", strerror(err)); + fprintf(stderr, "%s\n", strerror_r(err, buf, sizeof(buf))); exit(abs(err)); } |