Changeset 4499:0f9cbe98ac0b in roaraudio


Ignore:
Timestamp:
10/13/10 02:54:53 (8 years ago)
Author:
phi
Branch:
default
Message:

fixed off by one error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/caps.c

    r4498 r4499  
    110110 size_t i; 
    111111 
     112 ROAR_DBG("roar_caps_stds(con=%p, out=%p, in=%p, flags=0x%.4x) = ?", con, out, in, flags); 
     113 
    112114 if ( flags == -1 ) 
    113115  flags = 0; 
     
    148150  if ( data == NULL ) { 
    149151   for (i = 0; i < in->stds_len; i++) { 
    150     ((uint32_t*)mes.data)[i+1] = ROAR_HOST2NET32(((uint32_t*)mes.data)[i+1]); 
     152    ((uint32_t*)mes.data)[i] = ROAR_HOST2NET32(((uint32_t*)mes.data)[i]); 
    151153   } 
    152154  } else { 
    153155   for (i = 0; i < in->stds_len; i++) { 
    154     ((uint32_t*)data)[i+1] = ROAR_HOST2NET32(((uint32_t*)data)[i+1]); 
     156    ((uint32_t*)data)[i] = ROAR_HOST2NET32(((uint32_t*)data)[i]); 
    155157   } 
    156158  } 
     
    189191  } 
    190192 
     193  ROAR_DBG("roar_caps_stds(con=%p, out=%p, in=%p, flags=0x%.4x): (*out)->stds_len=%llu", con, out, in, flags, (long long unsigned int)(*out)->stds_len); 
     194 
    191195  for (i = 0; i < (*out)->stds_len; i++) { 
    192    (*out)->stds[i] = ROAR_NET2HOST32(((uint32_t*)caps.data)[i+1]); 
     196   (*out)->stds[i] = ROAR_NET2HOST32(((uint32_t*)caps.data)[i]); 
     197   ROAR_DBG("roar_caps_stds(con=%p, out=%p, in=%p, flags=0x%.4x): (*out)->stds[%llu] = 0x%.8x", con, out, in, flags, (long long unsigned int)i, (*out)->stds[i]); 
    193198  } 
    194199 } 
Note: See TracChangeset for help on using the changeset viewer.