1
0
mirror of https://github.com/KDE/krfb synced 2026-07-01 07:41:17 -07:00

Max size limits for scanf().

Correct arguments to scanf() - people, can't you read the warnings?
Got rid of two more warnings.

svn path=/trunk/kdenetwork/krfb/; revision=192448
This commit is contained in:
Luboš Luňák
2002-12-06 16:01:45 +00:00
parent 040539c60a
commit 1278d1879d

View File

@@ -61,8 +61,8 @@
#endif
static char *local_address = NULL;
static char *inet_address = NULL;
static const char *local_address = NULL;
static const char *inet_address = NULL;
/* max number of network interfaces*/
#define MAX_IF 8
@@ -85,7 +85,8 @@ char *getdefaultdev()
FILE *fp = fopen( PROCROUTE, "r");
char buff[4096], gate_addr[128], net_addr[128];
char mask_addr[128];
int irtt, window, mss, num, metric, iflags, refcnt, use;
int irtt, window, mss, num, metric, refcnt, use;
unsigned int iflags;
char i;
if( !fp ) {
return NULL;
@@ -93,9 +94,9 @@ char *getdefaultdev()
i=0;
// cruise through the list, and find the gateway interface
while( fgets(buff, 1023, fp) ) {
num = sscanf(buff, "%s %s %s %X %d %d %d %s %d %d %d\n",
num = sscanf(buff, "%15s %127s %127s %X %d %d %d %127s %d %d %d\n",
iface, net_addr, gate_addr, &iflags, &refcnt, &use, &metric,
&mask_addr, &mss, &window, &irtt);
mask_addr, &mss, &window, &irtt);
i++;
if( i == 1) continue;