aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-04-26 18:43:36 +0000
committerEric Andersen <andersen@codepoet.org>2001-04-26 18:43:36 +0000
commitca85cdbe4c414f5892b57a3c0fb2439f3061496c (patch)
tree75795176aceee4a9c91a2a924676180436f05cde
parent468f504fd79a590e632193fc0ecf999b86ae5cba (diff)
downloadbusybox-w32-ca85cdbe4c414f5892b57a3c0fb2439f3061496c.tar.gz
busybox-w32-ca85cdbe4c414f5892b57a3c0fb2439f3061496c.tar.bz2
busybox-w32-ca85cdbe4c414f5892b57a3c0fb2439f3061496c.zip
Doh. I never allocated storate for the struct stat I am using.
There was just a never initialized pointer. -Erik
-rw-r--r--chmod.c6
-rw-r--r--coreutils/chmod.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/chmod.c b/chmod.c
index 93b7f78cd..742770e90 100644
--- a/chmod.c
+++ b/chmod.c
@@ -30,12 +30,12 @@
30#include "busybox.h" 30#include "busybox.h"
31 31
32 32
33struct stat *theMode; 33struct stat theMode;
34 34
35 35
36static int fileAction(const char *fileName, struct stat *statbuf, void* junk) 36static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
37{ 37{
38 if (chmod(fileName, theMode->st_mode) == 0) 38 if (chmod(fileName, theMode.st_mode) == 0)
39 return (TRUE); 39 return (TRUE);
40 perror(fileName); 40 perror(fileName);
41 return (FALSE); 41 return (FALSE);
@@ -59,7 +59,7 @@ int chmod_main(int argc, char **argv)
59 59
60 if (argc > optind && argc > 2 && argv[optind]) { 60 if (argc > optind && argc > 2 && argv[optind]) {
61 /* Parse the specified mode */ 61 /* Parse the specified mode */
62 if (parse_mode(argv[optind], &(theMode->st_mode)) == FALSE) { 62 if (parse_mode(argv[optind], &(theMode.st_mode)) == FALSE) {
63 error_msg_and_die( "unknown mode: %s", argv[optind]); 63 error_msg_and_die( "unknown mode: %s", argv[optind]);
64 } 64 }
65 } else { 65 } else {
diff --git a/coreutils/chmod.c b/coreutils/chmod.c
index 93b7f78cd..742770e90 100644
--- a/coreutils/chmod.c
+++ b/coreutils/chmod.c
@@ -30,12 +30,12 @@
30#include "busybox.h" 30#include "busybox.h"
31 31
32 32
33struct stat *theMode; 33struct stat theMode;
34 34
35 35
36static int fileAction(const char *fileName, struct stat *statbuf, void* junk) 36static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
37{ 37{
38 if (chmod(fileName, theMode->st_mode) == 0) 38 if (chmod(fileName, theMode.st_mode) == 0)
39 return (TRUE); 39 return (TRUE);
40 perror(fileName); 40 perror(fileName);
41 return (FALSE); 41 return (FALSE);
@@ -59,7 +59,7 @@ int chmod_main(int argc, char **argv)
59 59
60 if (argc > optind && argc > 2 && argv[optind]) { 60 if (argc > optind && argc > 2 && argv[optind]) {
61 /* Parse the specified mode */ 61 /* Parse the specified mode */
62 if (parse_mode(argv[optind], &(theMode->st_mode)) == FALSE) { 62 if (parse_mode(argv[optind], &(theMode.st_mode)) == FALSE) {
63 error_msg_and_die( "unknown mode: %s", argv[optind]); 63 error_msg_and_die( "unknown mode: %s", argv[optind]);
64 } 64 }
65 } else { 65 } else {