diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2012-02-16 21:53:16 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2012-02-16 21:53:16 -0800 |
commit | 791b107e7a225103ee76c921c3c4a96d0e1adae2 (patch) | |
tree | 80d8e58053fbca2087d57b7fa8cbca7c594aa764 /src/base/cmd | |
parent | 933744347b36315b42338dfdee5934f87d029398 (diff) | |
download | abc-791b107e7a225103ee76c921c3c4a96d0e1adae2.tar.gz abc-791b107e7a225103ee76c921c3c4a96d0e1adae2.tar.bz2 abc-791b107e7a225103ee76c921c3c4a96d0e1adae2.zip |
Silencing some of the gcc warnings.
Diffstat (limited to 'src/base/cmd')
-rw-r--r-- | src/base/cmd/cmdPlugin.c | 2 | ||||
-rw-r--r-- | src/base/cmd/cmdUtils.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/base/cmd/cmdPlugin.c b/src/base/cmd/cmdPlugin.c index 84e89cb1..f14eed55 100644 --- a/src/base/cmd/cmdPlugin.c +++ b/src/base/cmd/cmdPlugin.c @@ -332,7 +332,7 @@ static unsigned textToBin(char* text, unsigned long text_sz) char* dst = text; const char* src = text; unsigned sz, i; - sscanf(src, "%lu ", &sz); + sscanf(src, "%u ", &sz); while(*src++ != ' '); for ( i = 0; i < sz; i += 3 ) { diff --git a/src/base/cmd/cmdUtils.c b/src/base/cmd/cmdUtils.c index e6dbed4e..3849b580 100644 --- a/src/base/cmd/cmdUtils.c +++ b/src/base/cmd/cmdUtils.c @@ -49,11 +49,12 @@ static int CmdCommandPrintCompare( Abc_Command ** ppC1, Abc_Command ** ppC2 ); ***********************************************************************/ int cmdCheckShellEscape( Abc_Frame_t * pAbc, int argc, char ** argv) { + int RetValue; if (argv[0][0] == '!') { const int size = 4096; int i; - char buffer[4096]; + char * buffer = ABC_ALLOC(char, 10000); strncpy (buffer, &argv[0][1], size); for (i = 1; i < argc; ++i) { @@ -62,7 +63,8 @@ int cmdCheckShellEscape( Abc_Frame_t * pAbc, int argc, char ** argv) } if (buffer[0] == 0) strncpy (buffer, "/bin/sh", size); - system (buffer); + RetValue = system (buffer); + ABC_FREE( buffer ); // NOTE: Since we reconstruct the cmdline by concatenating // the parts, we lose information. So a command like |