summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-07-31 15:24:59 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-07-31 15:24:59 +0200
commit39581495b85d8c20eb992962250af3044244dab3 (patch)
tree2aa74b3e1c9093ea23cfc98085a8e987065b3ad8
parente60c006499ec9a1604f85f84a98145535a7ad0a7 (diff)
downloadabrt-39581495b85d8c20eb992962250af3044244dab3.tar.gz
abrt-39581495b85d8c20eb992962250af3044244dab3.tar.xz
abrt-39581495b85d8c20eb992962250af3044244dab3.zip
small fixes to dumpoops
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--lib/Utils/logging.cpp2
-rw-r--r--src/Hooks/dumpoops.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/Utils/logging.cpp b/lib/Utils/logging.cpp
index 15104b8c..58d14ee9 100644
--- a/lib/Utils/logging.cpp
+++ b/lib/Utils/logging.cpp
@@ -46,7 +46,7 @@ void verror_msg(const char *s, va_list p, const char* strerr)
if (prefix_len) {
memmove(msg + prefix_len, msg, used);
used += prefix_len;
- strcpy(msg, msg_prefix);
+ memcpy(msg, msg_prefix, prefix_len);
}
if (strerr) {
if (s[0]) { /* not perror_nomsg? */
diff --git a/src/Hooks/dumpoops.cpp b/src/Hooks/dumpoops.cpp
index 5cad151b..208cb240 100644
--- a/src/Hooks/dumpoops.cpp
+++ b/src/Hooks/dumpoops.cpp
@@ -29,7 +29,8 @@ int main(int argc, char **argv)
log("usage: %s FILE", argv[0]);
return 1;
}
- msg_prefix = xasprintf("%s: ", argv[0]);
+ char *slash = strrchr(argv[0], '/');
+ msg_prefix = xasprintf("%s: ", slash ? slash+1 : argv[0]);
CKerneloopsScanner scanner;
int cnt = scanner.ScanSysLogFile(argv[1]);