• src/sbbs3/js_file.c

    From Deucе@VERT to Git commit to main/sbbs/master on Thu Mar 4 17:05:54 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/67c4ed071971b1428a300480
    Modified Files:
    src/sbbs3/js_file.c
    Log Message:
    Implement POSIX requirements for FD/Stream interactions.

    Documented here: https://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_05.html#tag_02_05_01
    This provides the best chance at read_raw() reading from the right
    location and updating the file pointer as expected while avoiding
    behaviour which is explicitly undefined by POSIX.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sun Apr 4 13:38:22 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/895d9cb37640d08e30a94ecc
    Modified Files:
    src/sbbs3/js_file.c
    Log Message:
    printf usage issue caught by Coverity.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sun Apr 4 15:13:57 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/9e69e9b8e9f3e2709d7dbf4f
    Modified Files:
    src/sbbs3/js_file.c
    Log Message:
    Fix some printf argument types

    CID 319023 319065 319134

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Thu Apr 22 20:22:12 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/8f79438d2ca277e2c8a25a24
    Modified Files:
    src/sbbs3/js_file.c
    Log Message:
    Use JS_ValueToECMAUint32 for File position, date, and length properties

    This resolves errors when setting these properties to values > 2147483647 example:
    !JavaScript /sbbs/exec/load/sauce_lib.js line 69: Error: can't convert 2430770157 to an integer

    That means you can now seek around (set position) within files > 2GB, truncate or extend a file > 2GB, or set a file's date to > Jan-19-2038.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Thu Dec 30 14:31:31 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/977b5cab754b783e5b12217b
    Modified Files:
    src/sbbs3/js_file.c
    Log Message:
    A few minor JSDOC fixes.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sat Jan 1 23:58:45 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/80020e4d5e82682275fc684f
    Modified Files:
    src/sbbs3/js_file.c
    Log Message:
    Document the new SHA1-related File properties.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sun Jan 2 15:58:28 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/a2a9dc027839f4faf19692b3
    Modified Files:
    src/sbbs3/js_file.c
    Log Message:
    Need to escape backslashes in JSDOC strings

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Tue Mar 1 22:43:08 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/77b90b5f5cb9633128efdf9d
    Modified Files:
    src/sbbs3/js_file.c
    Log Message:
    Zero-init write buffer in js_writebin()

    CID 350276

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Wed Mar 2 10:07:45 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/c920d0da9c8a9ebdcc6c94ac
    Modified Files:
    src/sbbs3/js_file.c
    Log Message:
    Fix possible negative offset to lseek()

    CID 327965

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sat Jun 25 15:20:45 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/c5ad7fc5c635cdc4db13df51
    Modified Files:
    src/sbbs3/js_file.c
    Log Message:
    Add support for reading/writing 8-byte (64-bit) integers in binary files

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Mon Jan 16 20:41:25 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/d797b759823692f607962bf8
    Modified Files:
    src/sbbs3/js_file.c
    Log Message:
    Add File method: iniRemoveSections()

    to remove all sections in an .ini file or all sections with a specified
    prefix.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (in GitKraken)@VERT to Git commit to main/sbbs/master on Tue Mar 14 21:25:14 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/1f86e81c78290852da97a86d
    Modified Files:
    src/sbbs3/js_file.c
    Log Message:
    Fix JSDOC typo

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Fri Sep 13 20:08:11 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/105627890fa49ca6a6198408
    Modified Files:
    src/sbbs3/js_file.c
    Log Message:
    Eliminte weird gcc (12.2) warning in release build (only)

    Increasing size of mode[] element by 2 bytes eliminated these GCC warnings
    that seem like false-positives to me:

    sbbs.h:194:48: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
    194 | (ret)[JSSTSpos]=(char)JSSTSstrval[JSSTSpos]; \
    | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    js_file.c:225:25: note: in expansion of macro ‘JSSTRING_TO_STRBUF’
    225 | JSSTRING_TO_STRBUF(cx, str, p->mode, sizeof(p->mode), NULL);
    | ^~~~~~~~~~~~~~~~~~
    js_file.c:42:17: note: at offset 5 into destination object ‘mode’ of size 5
    42 | char mode[5];
    | ^~~~

    Similar use of JSSTRING_TO_STRBUF in other files (js_console.cpp, js_archive.c) (with larger target buffers) does not trigger the same warnings.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Sat Sep 21 13:08:41 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/6ba59a06b546c1ed0e3b2b8b
    Modified Files:
    src/sbbs3/js_file.c
    Log Message:
    Add missing NULL pointer check to js_iniReadAll()

    iniReadFile() can return NULL upon file read error or malloc error. Let's not crash if that happens.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Tue Oct 1 00:11:39 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/5e1087e457db2b41dab45deb
    Modified Files:
    src/sbbs3/js_file.c
    Log Message:
    File.read() encodes base64, it doesn't decode.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net