diff options
author | Thomas Graf <tgraf@suug.ch> | 2013-02-28 13:07:04 +0100 |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2013-02-28 13:07:04 +0100 |
commit | 4d7680c19c131175e2ec431de9a026230c968a7e (patch) | |
tree | f124f02b933d6e88e8f53047a1cf05df377281af /lib/handlers.c | |
parent | ded20487fd631f7fcfc8f3cc547f6a8852501b83 (diff) | |
download | libnl-4d7680c19c131175e2ec431de9a026230c968a7e.tar.gz |
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 'lib/handlers.c')
-rw-r--r-- | lib/handlers.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/handlers.c b/lib/handlers.c index ee1376b0..e52c850f 100644 --- a/lib/handlers.c +++ b/lib/handlers.c @@ -79,9 +79,10 @@ static int nl_error_handler_verbose(struct sockaddr_nl *who, struct nlmsgerr *e, void *arg) { FILE *ofd = arg ? arg : stderr; + char buf[256]; fprintf(ofd, "-- Error received: %s\n-- Original message: ", - strerror(-e->error)); + strerror_r(-e->error, buf, sizeof(buf))); print_header_content(ofd, &e->msg); fprintf(ofd, "\n"); |