Skip to content

Commit

Permalink
fix c_prompt() casting previous prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
chiayolin committed Jul 28, 2015
1 parent 9f4c06f commit e18cd8c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/inte/inte.c
Original file line number Diff line number Diff line change
@@ -1,7 1,7 @@
/*
* nbc - shell.c - interactive mode
* nbc - inte.c - interactive mode
* Number Base Converter
* Copyright (C) 2014 Chiayo Lin <[email protected]>
* Copyright (C) 2014, 2015 Chiayo Lin <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -231,6 231,9 @@ void c_prompt(char *arg[], int argc) {
strcpy(Prompt, "");
return;
}

/* clean up the previous prompt */
strncpy(Prompt, "", MAX);

strcpy(Prompt, arg[1]);
Prompt[strlen(Prompt)] = ' ';
Expand Down

0 comments on commit e18cd8c

Please sign in to comment.