Changeset 65f7886 for src/effects


Ignore:
Timestamp:
May 10, 2019, 9:53:24 AM (6 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/cnn, feature/crepe, feature/timestretch, fix/ffmpeg5, master
Children:
c62243f
Parents:
7a02ce9
Message:

[effects] remove asserts from aubio_split_str

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/effects/rubberband_utils.c

    r7a02ce9 r65f7886  
    1818#include <stdlib.h>
    1919#include <string.h>
    20 #include <assert.h>
    2120
    2221char_t** aubio_split_str(const char_t* str, const char_t sep) {
     
    4544  result = AUBIO_ARRAY(char_t*, count);
    4645  if (result) {
    47     uint_t idx  = 0;
     46    uint_t idx = 0;
    4847    char_t* params = strtok(input, delim);
    4948    while (params) {
    5049      // make sure we don't got in the wild
    51       assert(idx < count);
     50      if (idx >= count)
     51        break;
    5252      *(result + idx++) = strdup(params);
    5353      params = strtok(0, delim);
    5454    }
    55     assert(idx == count - 1);
    56     // add null string at the end
    57     *(result + idx) = 0;
     55    // add null string at the end if needed
     56    if (idx < count - 1)
     57      *(result + idx) = 0;
    5858  }
    5959  return result;
Note: See TracChangeset for help on using the changeset viewer.