init output_string to NULL, and check in printbase() to make sure we don't pass garbage

This commit is contained in:
Ben Collins 2000-09-13 21:44:37 +00:00
parent 66e3b39001
commit 85747c5c55
2 changed files with 5 additions and 1 deletions

View File

@ -331,7 +331,7 @@ change_base( int type, char **base, char *s )
{
register char *cp; /* utility pointers */
char **rdns; /* for parsing */
char *output_string; /* for nice output */
char *output_string = NULL; /* for nice output */
int num_picked; /* # of selected base */
int j; /* used with num_picked */
int i = 1; /* index into choices array */

View File

@ -44,6 +44,10 @@ printbase( char *lead, char *s )
if (debug & D_TRACE)
printf("->printbase(%s, %s)\n", lead, s);
#endif
if (lead == NULL) {
printf("root");
return;
}
if (s == NULL) {
printf("%sroot\n", lead);
return;