diff options
Diffstat (limited to 'libhb/common.c')
-rw-r--r-- | libhb/common.c | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/libhb/common.c b/libhb/common.c index e501982f8..4e96f72e9 100644 --- a/libhb/common.c +++ b/libhb/common.c @@ -5704,70 +5704,3 @@ void hb_chapter_dequeue(hb_chapter_queue_t *q, hb_buffer_t *buf) free(item); } } - -size_t hb_getline(char ** lineptr, size_t * n, FILE * fp) -{ -#ifdef SYS_MINGW - char * bufptr = NULL; - char * p = bufptr; - size_t size; - int c; - - if (lineptr == NULL) - { - return -1; - } - if (fp == NULL) - { - return -1; - } - if (n == NULL) - { - return -1; - } - bufptr = *lineptr; - size = *n; - - c = fgetc(fp); - if (c == EOF) - { - return -1; - } - if (bufptr == NULL) - { - bufptr = malloc(128); - if (bufptr == NULL) - { - return -1; - } - size = 128; - } - p = bufptr; - while (c != EOF) - { - if ((p - bufptr) > (size - 1)) - { - size = size + 128; - bufptr = realloc(bufptr, size); - if (bufptr == NULL) - { - return -1; - } - } - *p++ = c; - if (c == '\n') - { - break; - } - c = fgetc(fp); - } - - *p++ = '\0'; - *lineptr = bufptr; - *n = size; - - return p - bufptr - 1; -#else - return getline(lineptr, n, fp); -#endif -} |