Browse Source

fix macrodefinition

master
10195501441 4 years ago
parent
commit
686b356247
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      yeeshell.c

+ 2
- 2
yeeshell.c View File

@ -30,7 +30,7 @@ int main()
char *cmdline = NULL, *pwd = NULL; char *cmdline = NULL, *pwd = NULL;
char *args[ARGS_MAX_QUANTITY]; char *args[ARGS_MAX_QUANTITY];
int status = 1; int status = 1;
pwd = (char *)calloc(PATH_MAX, sizeof(char));
pwd = (char *)calloc(PATH_MAX_SIZE, sizeof(char));
for (int i = 0; i < CMDLINE_HISTORY_MAX_QUANTITY; i++) for (int i = 0; i < CMDLINE_HISTORY_MAX_QUANTITY; i++)
{ {
history[i] = (char *)calloc(CMDLINE_MAX_SIZE, sizeof(char)); history[i] = (char *)calloc(CMDLINE_MAX_SIZE, sizeof(char));
@ -48,7 +48,7 @@ int main()
/* execute the shell's read, parse and execution loop */ /* execute the shell's read, parse and execution loop */
do do
{ {
if (!getcwd(pwd, PATH_MAX))
if (!getcwd(pwd, PATH_MAX_SIZE))
{ {
printf("yeeshell: The current path cannot be obtained!\n"); printf("yeeshell: The current path cannot be obtained!\n");
exit(0); exit(0);

Loading…
Cancel
Save