Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'libgloss/m68k/bdm-system.c')
-rw-r--r--libgloss/m68k/bdm-system.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libgloss/m68k/bdm-system.c b/libgloss/m68k/bdm-system.c
index 433713072..75a82e2a7 100644
--- a/libgloss/m68k/bdm-system.c
+++ b/libgloss/m68k/bdm-system.c
@@ -36,11 +36,11 @@ int _system (const char *command)
gdb_parambuf_t parameters;
parameters[0] = (uint32_t) command;
- parameters[1] = (uint32_t) strlen (command) + 1;
+ parameters[1] = command ? (uint32_t) strlen (command) + 1 : 0;
BDM_TRAP (BDM_SYSTEM, (uint32_t)parameters);
errno = convert_from_gdb_errno (parameters[1]);
e = parameters[0];
- if (e >= 0)
+ if (e >= 0 && command)
{
/* We have to convert e, an exit status to the encoded status of
the command. To avoid hard coding the exit status, we simply