Changeset 4931:7790d8d66cb5 in roaraudio


Ignore:
Timestamp:
05/08/11 16:46:57 (11 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

small cleanup to avoid buffer overflow problems

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/debug.c

    r4875 r4931  
    118118 
    119119 va_start(ap, format); 
    120  ret = vsnprintf(buf, 8192, format, ap); 
     120 ret = vsnprintf(buf, sizeof(buf), format, ap); 
    121121 va_end(ap); 
     122 
     123 buf[sizeof(buf)-1] = 0; 
    122124 
    123125 if ( vio != NULL ) { 
     
    180182 ret = vsnprintf(bufp, sizeof(buf)-ret, format, ap); 
    181183 va_end(ap); 
     184 
     185 buf[sizeof(buf)-1] = 0; 
    182186 
    183187 len += ret; 
Note: See TracChangeset for help on using the changeset viewer.