This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug nptl/16876] New: nptl/sockperf.c:105: possible bad if test ?
- From: "dcb314 at hotmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Sat, 26 Apr 2014 10:34:10 +0000
- Subject: [Bug nptl/16876] New: nptl/sockperf.c:105: possible bad if test ?
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=16876
Bug ID: 16876
Summary: nptl/sockperf.c:105: possible bad if test ?
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: nptl
Assignee: unassigned at sourceware dot org
Reporter: dcb314 at hotmail dot com
CC: drepper.fsp at gmail dot com
Static analyser cppcheck says
[trunk/nptl/sockperf.c:105]: (style) A pointer can not be negative so it is
either pointless or an error to check if it is.
Source code is
servpoll[cnt].fd = socket (AF_UNIX, SOCK_STREAM, 0);
if (clisock < 0)
but
int clisock[nserv];
Maybe better code might be
servpoll[cnt].fd = socket (AF_UNIX, SOCK_STREAM, 0);
if (servpoll[cnt].fd < 0)
--
You are receiving this mail because:
You are on the CC list for the bug.