Changeset b8cedb6


Ignore:
Timestamp:
Feb 27, 2017, 10:26:01 AM (3 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, sampler
Children:
4f89154
Parents:
140b460
Message:

python/ext/py-source.c: copy string uri

Location:
python/ext
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/ext/py-sink.c

    r140b460 rb8cedb6  
    8181  }
    8282
    83   self->uri = "none";
     83  self->uri = NULL;
    8484  if (uri != NULL) {
    85     self->uri = uri;
     85    self->uri = (char_t *)malloc(sizeof(char_t) * (strnlen(uri, PATH_MAX) + 1));
     86    strncpy(self->uri, uri, strnlen(uri, PATH_MAX) + 1);
    8687  }
    8788
  • python/ext/py-source.c

    r140b460 rb8cedb6  
    101101  }
    102102
    103   self->uri = "none";
     103  self->uri = NULL;
    104104  if (uri != NULL) {
    105     self->uri = uri;
     105    self->uri = (char_t *)malloc(sizeof(char_t) * (strnlen(uri, PATH_MAX) + 1));
     106    strncpy(self->uri, uri, strnlen(uri, PATH_MAX) + 1);
    106107  }
    107108
Note: See TracChangeset for help on using the changeset viewer.