X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/652d9073459fce55104f0db8f64fc5b9100c979d..50fe92783ec33c56680822bf4c5b462844f20f85:/tools/include/getline.h?ds=sidebyside diff --git a/tools/include/getline.h b/tools/include/getline.h index 219be7520..b9a3f7150 100644 --- a/tools/include/getline.h +++ b/tools/include/getline.h @@ -40,10 +40,16 @@ static inline ssize_t getline(char **outbuf, size_t *outsize, FILE *fp) { - char *buf; size_t len; +#ifndef __CYGWIN__ + char *buf; buf = fgetln(fp, &len); +#else + char buf[512]; + fgets(buf, sizeof(buf), fp); + len = strlen(buf); +#endif if (buf == NULL) return (-1);