diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2006-06-10 00:31:19 +0400 |
---|---|---|
committer | Nathan Sidwell <nathan@codesourcery.com> | 2006-06-10 00:31:19 +0400 |
commit | 9205d8c99b0e9ad6710c114cf14ec83feff10f59 (patch) | |
tree | 50edd9057ec051949ec55d8e00a80f29b4136271 /libgloss/m68k/bdm-system.c | |
parent | c4f65466b96fbfcbc51a26bc6013ee20c86f0b6d (diff) |
libgloss/newlib-csl-sourcerygxx-4_1-8
* m68k/bdm-system.c (_system): Support system(NULL).
Diffstat (limited to 'libgloss/m68k/bdm-system.c')
-rw-r--r-- | libgloss/m68k/bdm-system.c | 4 |
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 |