diff options
author | antirez <antirez@gmail.com> | 2020-07-02 12:50:34 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2020-07-02 12:50:39 +0200 |
commit | 806d41273267e48611c6c1171c61afa43b88b0c0 (patch) | |
tree | f7c5b2aa802d84819b4594240c72ebab95ef77a0 | |
parent | e10bc606f03750a211ae430b6e2079d8e5b1ed85 (diff) | |
download | filo-806d41273267e48611c6c1171c61afa43b88b0c0.tar.gz filo-806d41273267e48611c6c1171c61afa43b88b0c0.zip |
Get rid of non ANSI C strdup().
-rw-r--r-- | kilo.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -790,7 +790,9 @@ int editorOpen(char *filename) { E.dirty = 0; free(E.filename); - E.filename = strdup(filename); + size_t fnlen = strlen(filename)+1; + E.filename = malloc(fnlen); + memcpy(E.filename,filename,fnlen); fp = fopen(filename,"r"); if (!fp) { |