Changeset 5896:aef8b3923086 in roaraudio for libroar/vio_cmd.c


Ignore:
Timestamp:
04/14/13 13:55:14 (11 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

cleanup of usage of hard coded buffer lengths. Migrated some cases to usage of sizeof()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/vio_cmd.c

    r5895 r5896  
    661661  } 
    662662 
    663   snprintf(command, 1024, "%s --batch --no-verbose --quiet --passphrase-repeat 0 --passphrase-fd %i %s %s", bin_gpg, pwpipe[0], para, opts); 
     663  snprintf(command, sizeof(command), "%s --batch --no-verbose --quiet --passphrase-repeat 0 --passphrase-fd %i %s %s", bin_gpg, pwpipe[0], para, opts); 
    664664 
    665665  write(pwpipe[1], pw, strlen(pw)); 
     
    667667  close(pwpipe[1]); 
    668668 } else { 
    669   snprintf(command, 1024, "%s --no-verbose --quiet %s %s", bin_gpg, para, opts); 
     669  snprintf(command, sizeof(command), "%s --no-verbose --quiet %s %s", bin_gpg, para, opts); 
    670670 } 
    671671 
     
    701701 char buf[1024]; 
    702702 
    703  snprintf(buf, 1024, "-e -r %s", recipient); 
     703 snprintf(buf, sizeof(buf), "-e -r %s", recipient); 
    704704 return roar_vio_open_gpg(calls, dst, pw, 1, buf, options); 
    705705} 
Note: See TracChangeset for help on using the changeset viewer.