• src/sbbs3/js_file.c

    From deuce@VERT to CVS commit on Tuesday, August 27, 2019 04:47:58
    src/sbbs3 js_file.c 1.185 1.186
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv11820

    Modified Files:
    js_file.c
    Log Message:
    Actually honour File.network_byte_order.




    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Wednesday, September 18, 2019 22:03:53
    src/sbbs3 js_file.c 1.186 1.187
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv17577

    Modified Files:
    js_file.c
    Log Message:
    Address some debug-log output issues with the File object:
    "4294967295 File closed"
    "0000 File closed: /path/to/file"



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Wednesday, September 18, 2019 22:49:02
    src/sbbs3 js_file.c 1.187 1.188
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv27489

    Modified Files:
    js_file.c
    Log Message:
    Don't leak FILE streams for calls to js_CreateFileObject(), setting external
    to TRUE meant the FILE* (created with fdopen) would never be closed. So we now duplicate the file descriptor and get rid of the external flag, always closing Files (FILE streams) upon File object finalize.
    This fixes the resource leak leading to the eventual "Error 24 opening ..." in the ircd.js when loaded via jsexec, on Windows. This error happened after
    169 calls to load(true,...), because each background load creates 3 Files
    (for stdin/out/err) and those FILE streams were never closed/freed, and
    169 * 3 = 507, plus a few open files = 512, the maximum number of open file streams in the Microsoft CRTL apparently. Thanks to Deuce for recognizing these numbers as "magic" and pointing to the likely cause.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From deuce@VERT to CVS commit on Wednesday, September 18, 2019 22:54:49
    src/sbbs3 js_file.c 1.188 1.189
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv29285

    Modified Files:
    js_file.c
    Log Message:
    Even more leak paranoia...
    If dup() fails, return NULL
    If callog() fails, fclose() the new FILE*
    No functional change (hopefully).




    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Sunday, April 05, 2020 21:21:02
    src/sbbs3 js_file.c 1.190 1.191
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv9740

    Modified Files:
    js_file.c
    Log Message:
    Don't try to convert null or undefined arguments to integers.
    Moved some dbprintf() lines around a bit.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Monday, April 06, 2020 17:31:21
    src/sbbs3 js_file.c 1.191 1.192
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv15683

    Modified Files:
    js_file.c
    Log Message:
    Special handling of negative numbers in the writeBin() method implementation. JS numbers are double-precision floating points (doubles) and doubles cannot
    be converted to unsigned integers uniformly across all architectures (e.g. specifically on ARM, negative numbers would mostly get converted to 0U).

    For details, see https://www.embeddeduse.com/2013/08/25/casting-a-negative-float-to-an-unsigned-int/


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Saturday, April 11, 2020 18:25:31
    src/sbbs3 js_file.c 1.192 1.193
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv18066

    Modified Files:
    js_file.c
    Log Message:
    Added optional "lowercase" argument to File.iniGetObject() and iniGetAllObjects() to sort of "normalize" the key names into easily-useable (and consistent) JavaScript property names.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Saturday, April 11, 2020 23:27:25
    src/sbbs3 js_file.c 1.193 1.194
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv428

    Modified Files:
    js_file.c
    Log Message:
    Restore the previous behavior of File.iniGetObject(null), even though not documented (it says if the section is *undefined*, the root section is read)


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Saturday, April 11, 2020 23:58:01
    src/sbbs3 js_file.c 1.194 1.195
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv4839

    Modified Files:
    js_file.c
    Log Message:
    Document the iniGetObject(null) behavior.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Thursday, April 16, 2020 21:37:14
    src/sbbs3 js_file.c 1.195 1.196
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv894

    Modified Files:
    js_file.c
    Log Message:
    Update to File.iniGetAllObjects(): read the .ini file all in one go using iniReadFile():
    - enables the use of the !include directive in the read .in file
    - reduces rewinds/re-reads of the .ini file, speeding up the total operation

    I also removed the old crash dump comments from here.


    ---
    þ 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 Friday, September 13, 2024 20:08:11
    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 Saturday, September 21, 2024 13:08:41
    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 Tuesday, October 01, 2024 00:11:39
    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