[BACK]Return to patch-src_helper_fileio_c CVS log [TXT][DIR] Up to [local] / ports / devel / openocd / patches

Annotation of ports/devel/openocd/patches/patch-src_helper_fileio_c, Revision 1.1

1.1     ! yason       1: $OpenBSD$
        !             2: --- src/helper/fileio.c.orig   Fri Jan 16 10:02:25 2009
        !             3: +++ src/helper/fileio.c        Wed May 27 11:20:39 2009
        !             4: @@ -53,19 +53,19 @@ int fileio_open_local(fileio_t *fileio)
        !             5:        switch (fileio->access)
        !             6:        {
        !             7:                case FILEIO_READ:
        !             8: -                      strcpy(access, "r");
        !             9: +                      strlcpy(access, "r", sizeof(access));
        !            10:                        break;
        !            11:                case FILEIO_WRITE:
        !            12: -                      strcpy(access, "w");
        !            13: +                      strlcpy(access, "w", sizeof(access));
        !            14:                        break;
        !            15:                case FILEIO_READWRITE:
        !            16: -                      strcpy(access, "w+");
        !            17: +                      strlcpy(access, "w+", sizeof(access));
        !            18:                        break;
        !            19:                case FILEIO_APPEND:
        !            20: -                      strcpy(access, "a");
        !            21: +                      strlcpy(access, "a", sizeof(access));
        !            22:                        break;
        !            23:                case FILEIO_APPENDREAD:
        !            24: -                      strcpy(access, "a+");
        !            25: +                      strlcpy(access, "a+", sizeof(access));
        !            26:                        break;
        !            27:                default:
        !            28:                        LOG_ERROR("BUG: access neither read, write nor readwrite");
        !            29: @@ -77,7 +77,7 @@ int fileio_open_local(fileio_t *fileio)
        !            30:        if (fileio->type == FILEIO_BINARY)
        !            31:  #endif
        !            32:        {
        !            33: -              strcat(access, "b");
        !            34: +              strlcat(access, "b", sizeof(access));
        !            35:        }
        !            36:
        !            37:        if (!(fileio->file = open_file_from_path (fileio->url, access)))

CVSweb