/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to plugins.d/mandos-client.c

  • Committer: Teddy Hogeborn
  • Date: 2009-01-13 01:36:46 UTC
  • Revision ID: teddy@fukt.bsnet.se-20090113013646-1u21ie2oaotcekdz
* plugin-runner.c (main): Use "sscanf" instead of "strtol"; using the
                          correct type instead of casting.
* plugins.d/mandos-cliend.c (main): Detect an empty string when
                                    parsing DH bits and port number.
* plugins.d/splashy.c (main): Use "sscanf" instead of "strtoul"; using
                              the correct type instead of casting.
* plugins.d/usplash.c (main): - '' -

Show diffs side-by-side

added added

removed removed

Lines of Context:
884
884
          break;
885
885
        case 129:               /* --dh-bits */
886
886
          ret = sscanf(arg, "%u", &mc.dh_bits);
887
 
          if(ret == 0 or mc.dh_bits == 0){
 
887
          if(ret != 1){
888
888
            fprintf(stderr, "Bad number of DH bits\n");
889
889
            exit(EXIT_FAILURE);
890
890
          }
997
997
      }
998
998
      uint16_t port;
999
999
      ret = sscanf(address+1, "%" SCNu16, &port);
1000
 
      if(ret == 0 or port == 0){
 
1000
      if(ret != 1){
1001
1001
        fprintf(stderr, "Bad port number\n");
1002
1002
        exitcode = EXIT_FAILURE;
1003
1003
        goto end;