[Home]

Summary:DAHTOOL-00026: Incorrect construct in dahdi_monitor.c
Reporter:Guillaume Knispel (gknispel_proformatique)Labels:
Date Opened:2009-04-14 10:49:15Date Closed:2009-04-21 08:38:12
Priority:MinorRegression?No
Status:Closed/CompleteComponents:General
Versions:2.1.0.2 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:in main(), "opt" is a "char" and to parse command line arguments a "while ((opt = getopt(argc, argv, "vmol:f:r:t:s:F:R:T:S:")) != -1)" is done. This is incorrect and won't work on architectures where char are unsigned. Declaring "opt" as an "int" will fix the problem.
Comments:By: Jason Parker (jparker) 2009-04-14 11:27:16

This seems wrong at first glance, but the getopt man page agrees with you in no uncertain terms.

By: Digium Subversion (svnbot) 2009-04-21 08:38:11

Repository: dahdi
Revision: 6420

U   tools/trunk/dahdi_monitor.c

------------------------------------------------------------------------
r6420 | seanbright | 2009-04-21 08:38:11 -0500 (Tue, 21 Apr 2009) | 8 lines

Use correct return value type for getopt().

In dahdi_monitor.c, the return value of getopt() was being assigned to a char
while the function actually returns an int.  Fix suggested by reporter.

(closes issue DAHTOOL-26)
Reported by: gknispel_proformatique

------------------------------------------------------------------------

http://svn.digium.com/view/dahdi?view=rev&revision=6420