aboutsummaryrefslogtreecommitdiff
path: root/options.c
diff options
context:
space:
mode:
authorJuan Cespedes <cespedes@debian.org>1999-04-03 03:21:52 +0200
committerJuan Cespedes <cespedes@debian.org>1999-04-03 03:21:52 +0200
commite3eb9aa37086f16c0c8c2778dcd8020a39a92564 (patch)
tree7fa35424afa6429b758586ff07f4d8d48359dc72 /options.c
parentd44c6b8b090b8b7aa9d971d9e0bfd848732a3071 (diff)
downloadltrace-e3eb9aa37086f16c0c8c2778dcd8020a39a92564.tar.gz
Version: 0.3.7
* Minor fixes * Added minor patch from Alex Buell <alex.buell@tahallah.demon.co.uk> to be able to compile under glibc 2.1 * Additions to config file from David Dyck <dcd@tc.fluke.com> * Clean-up Makefile a bit * Changed `LT_PT_*' with `ARGTYPE_*' * Display '\\' instead of '\' * Updated list of syscalls and signals to linux-2.2.5 * Compiled against glibc-2.1
Diffstat (limited to 'options.c')
-rw-r--r--options.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/options.c b/options.c
index a8c1354..57a0f8e 100644
--- a/options.c
+++ b/options.c
@@ -9,7 +9,9 @@
#include <limits.h>
#if HAVE_GETOPT_H
+#define _GNU_SOURCE
#include <getopt.h>
+#undef _GNU_SOURCE
#endif
#include "ltrace.h"
@@ -97,7 +99,7 @@ static void usage(void)
static char * search_for_command(char * filename)
{
- static char pathname[PATH_MAX];
+ static char pathname[1024];
char *path;
int m, n;
@@ -111,7 +113,7 @@ static char * search_for_command(char * filename)
} else {
m = n = strlen(path);
}
- strncpy(pathname, path, n);
+ strncpy(pathname, path, n); /* Possible buffer overrun */
if (n && pathname[n - 1] != '/') {
pathname[n++] = '/';
}
@@ -197,7 +199,7 @@ char ** process_options(int argc, char **argv)
{
struct opt_p_t * tmp = malloc(sizeof(struct opt_p_t));
if (!tmp) {
- perror("malloc");
+ perror("ltrace: malloc");
exit(1);
}
tmp->pid = atoi(optarg);
@@ -209,7 +211,7 @@ char ** process_options(int argc, char **argv)
{
char * str_e = strdup(optarg);
if (!str_e) {
- perror("strdup");
+ perror("ltrace: strdup");
exit(1);
}
if (str_e[0]=='!') {
@@ -224,7 +226,7 @@ char ** process_options(int argc, char **argv)
}
tmp = malloc(sizeof(struct opt_e_t));
if (!tmp) {
- perror("malloc");
+ perror("ltrace: malloc");
exit(1);
}
tmp->name = str_e;
@@ -245,7 +247,7 @@ char ** process_options(int argc, char **argv)
"???"
#endif
".\n"
-"Copyright (C) 1997-1998 Juan Cespedes <cespedes@debian.org>.\n"
+"Copyright (C) 1997-1999 Juan Cespedes <cespedes@debian.org>.\n"
"This is free software; see the GNU General Public Licence\n"
"version 2 or later for copying conditions. There is NO warranty.\n");
exit(0);