Changeset 501 in ntrip for trunk/ntripclient


Ignore:
Timestamp:
Oct 8, 2007, 10:03:19 AM (12 years ago)
Author:
stoecker
Message:

minor fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ntripclient/ntripclient.c

    r500 r501  
    11/*
    22  Easy example NTRIP client for POSIX.
    3   $Id: ntripclient.c,v 1.32 2007/09/18 10:39:19 stoecker Exp $
     3  $Id: ntripclient.c,v 1.33 2007/10/05 15:40:24 stuerze Exp $
    44  Copyright (C) 2003-2005 by Dirk Stoecker <soft@dstoecker.de>
    55   
     
    4545
    4646/* CVS revision and version */
    47 static char revisionstr[] = "$Revision: 1.32 $";
    48 static char datestr[]     = "$Date: 2007/09/18 10:39:19 $";
     47static char revisionstr[] = "$Revision: 1.33 $";
     48static char datestr[]     = "$Date: 2007/10/05 15:40:24 $";
    4949
    5050enum MODE { HTTP = 1, RTSP = 2, NTRIP1 = 3, AUTO = 4, END };
     
    8181{ "user",       required_argument, 0, 'u'},
    8282{ "nmea",       required_argument, 0, 'n'},
     83{ "mode",       required_argument, 0, 'M'},
    8384{ "help",       no_argument,       0, 'h'},
    8485{0,0,0,0}};
     
    113114  static char buf[128];
    114115  char *urlenc = buf;
    115   char *bufend = buf + sizeof(buf);
    116 
    117   while(*req && urlenc != bufend)
     116  char *bufend = buf + sizeof(buf) - 3;
     117
     118  while(*req && urlenc < bufend)
    118119  {
    119120    if(isalnum(*req)
     
    127128      *req++;
    128129    }
    129   }
     130  }
     131  *urlenc = 0;
    130132  return buf;
    131133}
     
    292294    case 'p': args->password = optarg; break;
    293295    case 'd':
    294        if(*optarg == '?')
     296       if(optarg && *optarg == '?')
    295297         args->data = encodeurl(optarg);
    296298       else
Note: See TracChangeset for help on using the changeset viewer.