Mercurial > repos > blastem
comparison util.c @ 682:7ed1dbb48f61
Merge
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 04 Jan 2015 23:35:55 -0800 |
parents | 6b248602ab84 |
children | fc68992cf18d |
comparison
equal
deleted
inserted
replaced
681:e26640daf1ae | 682:7ed1dbb48f61 |
---|---|
90 linktext = malloc(cursize); | 90 linktext = malloc(cursize); |
91 linksize = readlink(path, linktext, cursize-1); | 91 linksize = readlink(path, linktext, cursize-1); |
92 if (linksize == -1) { | 92 if (linksize == -1) { |
93 perror("readlink"); | 93 perror("readlink"); |
94 free(linktext); | 94 free(linktext); |
95 linktext = NULL; | 95 return NULL; |
96 } | 96 } |
97 } while ((linksize+1) > cursize); | 97 } while ((linksize+1) > cursize); |
98 linktext[linksize] = 0; | 98 linktext[linksize] = 0; |
99 return linktext; | 99 return linktext; |
100 } | 100 } |