Mercurial > repos > blastem
comparison util.c @ 559:6b248602ab84
blastem builds and almost works on OS X now
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 17 Jun 2014 01:50:29 -0400 |
parents | 32da1e0d5e55 |
children | fc68992cf18d |
comparison
equal
deleted
inserted
replaced
558:dc9f178085a0 | 559:6b248602ab84 |
---|---|
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 } |