]> andersk Git - moira.git/commitdiff
Don't expect valid data in a qelem if do_mr_query had a non-zero return
authorzacheiss <zacheiss>
Fri, 14 Sep 2001 20:30:50 +0000 (20:30 +0000)
committerzacheiss <zacheiss>
Fri, 14 Sep 2001 20:30:50 +0000 (20:30 +0000)
value.

Need to initialize account_number before using it with GetValueFromUser.

clients/moira/cluster.c

index 9fc938a9be6a173e55b680b55a22cdc84ef484cf..1d7d2a0c739fe88892913ad65c86623dcdf36b46 100644 (file)
@@ -295,7 +295,7 @@ static char *PrintMachInfo(char **info)
   stat = do_mr_query("get_subnet", 1, args, StoreInfo, &elem);
   if (stat)
     com_err(program_name, stat, " looking up subnet info");
-  if (atoi(((char **)elem->q_data)[2]) == SNET_STATUS_PRIVATE)
+  else if (atoi(((char **)elem->q_data)[2]) == SNET_STATUS_PRIVATE)
     {
       Put_message("");
       sprintf(buf, "Warning:  This host is on a private subnet.");
@@ -2080,6 +2080,7 @@ int MachineByAcctNumber(int argc, char **argv)
   int status;
   struct mqelem *elem = NULL;
 
+  account_number = strdup("");
   if (GetValueFromUser("Account Number", &account_number) == SUB_ERROR)
     return DM_NORMAL;
 
This page took 0.035849 seconds and 5 git commands to generate.