Ticket #51396: patch-catdump-getline.diff

File patch-catdump-getline.diff, 2.0 KB (added by amake (Aaron Madlon-Kay), 8 years ago)
  • catdump.c

    From 6981c596ece878ff581556a719608513f88208ae Mon Sep 17 00:00:00 2001
    From: Jari Aalto <jari.aalto@cante.net>
    Date: Sat, 9 Jan 2010 20:40:44 +0200
    Subject: [PATCH] Rename getline() to getline2() to avoid clash
    
    Signed-off-by: Jari Aalto <jari.aalto@cante.net>
    ---
     catdump.c |   12 ++++++------
     1 files changed, 6 insertions(+), 6 deletions(-)
    
    diff --git a/catdump.c b/catdump.c
    index b40bb27..8874db8 100644
    a b void outhex(); 
    201201void    outstr();
    202202void    outjstr();
    203203int     undump();
    204 uchr    *getline();
     204uchr    *getline2();  /* getline() is declared in /usr/include/stdio.h */
    205205uchr    *getvalue();
    206206int     gethex();
    207207int     hexdigit();
    char *txtfile, *catalog; 
    561561    err = 0;
    562562    line = 0;
    563563
    564     if (getline(buf, fp) == NULL ||
     564    if (getline2(buf, fp) == NULL ||
    565565        strncmp(buf, CAT_ENTRY, strlen(CAT_ENTRY))) {
    566566        fprintf(stderr, "ERR: ¹àÌÜ %s ¤¬¤¢¤ê¤Þ¤»¤ó\n", CAT_ENTRY);
    567567        fclose(fp);
    char *txtfile, *catalog; 
    571571    st = 0;
    572572    hdr = (HDR_T *)catbuf;
    573573    mask = 0L;
    574     while (getline(buf, fp) != NULL && *buf != '[') {
     574    while (getline2(buf, fp) != NULL && *buf != '[') {
    575575        if ((p = getvalue(buf)) == NULL) {
    576576            fprintf(stderr, "ERR: line %d: ¹½Ê¸¤Ë¸í¤ê¤¬¤¢¤ê¤Þ¤¹\n", line);
    577577            err++;
    char *txtfile, *catalog; 
    666666        if (strncmp(buf, BOOK_ENTRY, strlen(BOOK_ENTRY))) {
    667667            fprintf(stderr, "ERR: line %d: ÉÔÌÀ¤Ê¹àÌܤǤ¹(%s)\n", line, buf);
    668668            err++;
    669             while (getline(buf, fp) != NULL && *buf != '[')
     669            while (getline2(buf, fp) != NULL && *buf != '[')
    670670                ;
    671671            if (*buf == '\0')
    672672                break;
    char *txtfile, *catalog; 
    680680            break;
    681681        }
    682682        mask = 0;
    683         while (getline(buf, fp) != NULL && *buf != '[') {
     683        while (getline2(buf, fp) != NULL && *buf != '[') {
    684684            if ((p = getvalue(buf)) == NULL) {
    685685                fprintf(stderr, "ERR: line %d: ¹½Ê¸¤Ë¸í¤ê¤¬¤¢¤ê¤Þ¤¹\n", line);
    686686                err++;
    char *txtfile, *catalog; 
    917917}
    918918
    919919uchr *
    920 getline(buf, fp)
     920getline2(buf, fp)
    921921uchr    *buf;
    922922FILE    *fp;
    923923{