[asterisk-bugs] [DAHDI-tools 0014893]: Incorrect construct in dahdi_monitor.c

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Apr 21 08:38:11 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=14893 
====================================================================== 
Reported By:                gknispel_proformatique
Assigned To:                
====================================================================== 
Project:                    DAHDI-tools
Issue ID:                   14893
Category:                   General
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2009-04-14 10:49 CDT
Last Modified:              2009-04-21 08:38 CDT
====================================================================== 
Summary:                    Incorrect construct in dahdi_monitor.c
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.

====================================================================== 

---------------------------------------------------------------------- 
 (0103524) svnbot (reporter) - 2009-04-21 08:38
 http://bugs.digium.com/view.php?id=14893#c103524 
---------------------------------------------------------------------- 
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 http://bugs.digium.com/view.php?id=14893)
Reported by: gknispel_proformatique

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

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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-04-21 08:38 svnbot         Checkin                                      
2009-04-21 08:38 svnbot         Note Added: 0103524                          
======================================================================




More information about the asterisk-bugs mailing list