[BACK]Return to radioctl.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / radioctl

Diff for /src/usr.bin/radioctl/radioctl.c between version 1.16 and 1.17

version 1.16, 2008/10/16 14:32:57 version 1.17, 2010/06/29 05:00:05
Line 37 
Line 37 
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
 #include <unistd.h>  #include <unistd.h>
   #include <ctype.h>
   
 #define RADIO_ENV       "RADIODEVICE"  #define RADIO_ENV       "RADIODEVICE"
 #define RADIODEVICE     "/dev/radio"  #define RADIODEVICE     "/dev/radio"
Line 429 
Line 430 
   
         slen -= ++optlen;          slen -= ++optlen;
   
         if ((topt = (char *)malloc(optlen)) == NULL) {          if ((topt = malloc(optlen)) == NULL) {
                 warn("memory allocation error");                  warn("memory allocation error");
                 return 0;                  return 0;
         }          }
Line 465 
Line 466 
                 break;                  break;
         case 'o':          case 'o':
                 if (strncmp(topt, offchar,                  if (strncmp(topt, offchar,
                         slen > OFFCHAR_LEN ? slen : OFFCHAR_LEN) == 0)                      slen > OFFCHAR_LEN ? slen : OFFCHAR_LEN) == 0)
                         o->value = 0;                          o->value = 0;
                 else if (strncmp(topt, onchar,                  else if (strncmp(topt, onchar,
                                 slen > ONCHAR_LEN ? slen : ONCHAR_LEN) == 0)                      slen > ONCHAR_LEN ? slen : ONCHAR_LEN) == 0)
                                 o->value = 1;                          o->value = 1;
                 break;                  break;
         case 'u':          case 'u':
                 if (strncmp(topt, "up", slen > 2 ? slen : 2) == 0)                  if (strncmp(topt, "up", slen > 2 ? slen : 2) == 0)
Line 480 
Line 481 
                         o->value = 0;                          o->value = 0;
                 break;                  break;
         default:          default:
                 if (*topt > 47 && *topt < 58)                  if (isdigit(*topt))
                         o->value = str_to_int(topt, o->option);                          o->value = str_to_int(topt, o->option);
                 break;                  break;
         }          }

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17