Changeset 5589:de9dbc2ecc4b in roaraudio


Ignore:
Timestamp:
07/22/12 13:21:15 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

Updated UUID support to fixs shortcoming detected by rpld. Closes: #276 (critical bug)

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r5579 r5589  
    1010        * Support a common protocol interface (Closes: #257) 
    1111        * Converted roard plugins to universal where possible (Closes: #256) 
     12        * Corrected critical bug in UUID support (compare function overwrote 
     13          arguments) (Closes: #276) 
    1214 
    1315v. 1.0beta3 - Sun Jul 15 2012 26:08 CEST 
  • include/libroar/uuid.h

    r5505 r5589  
    5050}; 
    5151 
    52 int roar_uuid_eq(roar_uuid_t a, roar_uuid_t b); 
    53 int roar_uuid2str(char * str, roar_uuid_t uuid, ssize_t len); 
     52// compare two UUIDs: return 1 if they are the same, 0 if they are not and -1 in case of error. 
     53int roar_uuid_eq(const roar_uuid_t a, const roar_uuid_t b); 
     54 
     55int roar_uuid2str(char * str, const roar_uuid_t uuid, ssize_t len); 
    5456int roar_str2uuid(roar_uuid_t uuid, const char * str); 
    5557int roar_uuid_gen(roar_uuid_t uuid, enum roar_uuid_type type, roar_uuid_t ns, void * argp, ssize_t arglen); 
  • libroar/uuid.c

    r5505 r5589  
    3636#include "libroar.h" 
    3737 
    38 int roar_uuid_eq(roar_uuid_t a, roar_uuid_t b) { 
     38int roar_uuid_eq(const roar_uuid_t a, const roar_uuid_t b) { 
    3939 if ( a == NULL || b == NULL ) { 
    4040  roar_err_set(ROAR_ERROR_FAULT); 
     
    4242 } 
    4343 
    44  if ( memcpy(a, b, sizeof(roar_uuid_t)) == 0 ) 
     44 if ( memcmp(a, b, sizeof(roar_uuid_t)) == 0 ) 
    4545  return 1; 
    4646 
     
    4848} 
    4949 
    50 int roar_uuid2str(char * str, roar_uuid_t uuid, ssize_t len) { 
     50int roar_uuid2str(char * str, const roar_uuid_t uuid, ssize_t len) { 
    5151 if ( str == NULL || uuid == NULL ) { 
    5252  roar_err_set(ROAR_ERROR_FAULT); 
Note: See TracChangeset for help on using the changeset viewer.