Changeset d2be104 for src/io


Ignore:
Timestamp:
Apr 22, 2016, 8:08:27 PM (9 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
6f42c16
Parents:
2d0e3fc
Message:

src/io/: also copy null ending char

Location:
src/io
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • src/io/sink_apple_audio.c

    r2d0e3fc rd2be104  
    6868  }
    6969  if (s->path != NULL) AUBIO_FREE(s->path);
    70   s->path = AUBIO_ARRAY(char_t, strnlen(uri, PATH_MAX));
    71   strncpy(s->path, uri, strnlen(uri, PATH_MAX));
     70  s->path = AUBIO_ARRAY(char_t, strnlen(uri, PATH_MAX) + 1);
     71  strncpy(s->path, uri, strnlen(uri, PATH_MAX) + 1);
    7272
    7373  s->samplerate = 0;
  • src/io/sink_sndfile.c

    r2d0e3fc rd2be104  
    6464
    6565  if (s->path) AUBIO_FREE(s->path);
    66   s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX));
    67   strncpy(s->path, path, strnlen(path, PATH_MAX));
     66  s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX) + 1);
     67  strncpy(s->path, path, strnlen(path, PATH_MAX) + 1);
    6868
    6969  s->samplerate = 0;
  • src/io/sink_wavwrite.c

    r2d0e3fc rd2be104  
    9191
    9292  if (s->path) AUBIO_FREE(s->path);
    93   s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX));
    94   strncpy(s->path, path, strnlen(path, PATH_MAX));
     93  s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX) + 1);
     94  strncpy(s->path, path, strnlen(path, PATH_MAX) + 1);
    9595
    9696  s->max_size = MAX_SIZE;
  • src/io/source_apple_audio.c

    r2d0e3fc rd2be104  
    9797
    9898  if (s->path) AUBIO_FREE(s->path);
    99   s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX));
    100   strncpy(s->path, path, strnlen(path, PATH_MAX));
     99  s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX) + 1);
     100  strncpy(s->path, path, strnlen(path, PATH_MAX) + 1);
    101101
    102102  // open the resource url
  • src/io/source_avcodec.c

    r2d0e3fc rd2be104  
    8787
    8888  if (s->path) AUBIO_FREE(s->path);
    89   s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX));
    90   strncpy(s->path, path, strnlen(path, PATH_MAX));
     89  s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX) + 1);
     90  strncpy(s->path, path, strnlen(path, PATH_MAX) + 1);
    9191
    9292  // register all formats and codecs
  • src/io/source_sndfile.c

    r2d0e3fc rd2be104  
    8989
    9090  if (s->path) AUBIO_FREE(s->path);
    91   s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX));
    92   strncpy(s->path, path, strnlen(path, PATH_MAX));
     91  s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX) + 1);
     92  strncpy(s->path, path, strnlen(path, PATH_MAX) + 1);
    9393
    9494  // try opening the file, getting the info in sfinfo
  • src/io/source_wavread.c

    r2d0e3fc rd2be104  
    8888
    8989  if (s->path) AUBIO_FREE(s->path);
    90   s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX));
    91   strncpy(s->path, path, strnlen(path, PATH_MAX));
     90  s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX) + 1);
     91  strncpy(s->path, path, strnlen(path, PATH_MAX) + 1);
    9292
    9393  s->samplerate = samplerate;
Note: See TracChangeset for help on using the changeset viewer.