Changeset 298 for trunk/src/sh_port2proc.c
- Timestamp:
- Nov 1, 2010, 12:13:47 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_port2proc.c
r295 r298 352 352 unsigned int n, i, port, niface, inode, istatus; 353 353 char line[512]; 354 char ip_port[128]; 354 355 char iface[SH_IP_BUF]; 355 356 … … 363 364 #endif 364 365 365 if ( 5== sscanf(line,366 "%u: % s:%X%*X:%*X %X %*X:%*X %*X:%*X %*X %*d %*d %u %*s",367 &n, i face, &port, &istatus, &inode))366 if (4 == sscanf(line, 367 "%u: %127s %*X:%*X %X %*X:%*X %*X:%*X %*X %*d %*d %u %*s", 368 &n, ip_port, &istatus, &inode)) 368 369 { 369 370 struct sockaddr_in addr4; … … 371 372 struct sh_sockaddr ss; 372 373 374 char * p; 375 376 ip_port[127] = '\0'; 377 378 p = strchr(ip_port, ':'); 379 380 if (p) 381 { 382 *p = '\0'; ++p; 383 port = (unsigned int) strtoul(p, NULL, 16); 384 sl_strlcpy(iface, ip_port, sizeof(iface)); 385 } 386 else 387 { 388 continue; 389 } 390 373 391 niface = 0; 374 392
Note:
See TracChangeset
for help on using the changeset viewer.