• src/xpdev/ini_file.c

    From Rob Swindell (on ChromeOS)@1:103/705 to Git commit to main/sbbs/master on Sun Apr 30 11:38:04 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/b9e5efacac9390d5af47c56e
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    Fix memory leak in iniFreeParsedSections(), wasn't freeing the list memberThe 'list' member was allocated by iniParseSections() but never freed.Caught be Nelgin's recent valgrind report, e.g.:==2725235== 56 bytes in 1 blocks are indirectly lost in loss record 82 of 191==2725235== at 0x484DCD3: realloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)==2725235== by 0x4FA351C: strListAnnex (in /home/bbs/sbbs/repo/src/sbbs3/gcc.linux.x64.lib.release/libsbbs.so)==2725235== by 0x4F9ADDE: iniParseSections (in /home/bbs/sbbs/repo/src/sbbs3/gcc.linux.x64.lib.release/libsbbs.so)==2725235== by 0x49F1F0A: read_chat_cfg (in /home/bbs/sbbs/repo/src/sbbs3/gcc.linux.x64.lib.release/libsbbs.so)==2725235== by 0x49E8BF1: load_cfg (in /home/bbs/sbbs/repo/src/sbbs3/gcc.linux.x64.lib.release/libsbbs.so)==2725235== by 0x5C14C75: ftp_server (in /home/bbs/sbbs/repo/src/sbbs3/gcc.linux.x64.lib.release/libftpsrvr.so)==2725235== by 0x5D5AB42: start_thread (pthread_create.c:442)==2725235== by 0x5DEBBB3: clone (clone.S:100)
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Wed Feb 7 10:17:48 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/d2f5d55133310a6c03b91057
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    No strtoull() for Borland
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Wed Feb 7 10:21:34 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/cea188d03b824bafaf7b4622
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    Fix reversed logic of previous commit.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Tue Feb 20 15:56:44 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/4fd02c4efa228d777db94785
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    Partial fix of iniGetSString() and iniReadSString()
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Wed Feb 21 05:43:42 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/fbd2315bd2647948b18e26ae
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    And now Coverity gets into the false warning game.

    Fix incorrect Coverity issue that speculates this may return fval.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Wed Feb 21 06:30:32 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/fd41db08baa65e68618163f9
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    Cast away warning...

    This is why I returned ret. :D
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Wed Feb 21 09:59:18 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/2995f851439e440f60587b87
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    Bugfix and more paranoia in ini*SString() functions.

    Bugfis: Be sure to terminate value if returning deflt.
    Paranoia: Terminate value if iniGetString() returns NULL

    I think the only way to trigger the paranoia is to pass NULL as the
    default when reading a key that's not present.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Mon Mar 4 18:23:44 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/92088f9983ef38fc376208c2
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    For name ints/enums, allow the value to be longer than the name

    This allows me to shorten "Informational" to "Info" and "Debugging" to "Debug" and be backward compatible with existing .ini files. I think "Info" and
    "Debug" are universally known and take up less space (e.g. in SCFG).
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Fri Jan 24 16:12:04 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/3458846794cc2cb002c46b58
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    fseek() after ftruncate()

    Ensure the stream is in a meaningful place.
    Fixes a bug, but one we're unlikely to have ever seen the way we use
    this.
    --- SBBSecho 3.23-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Sat Sep 27 16:04:54 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/264234a8af6521996a8a672c
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    Allow iniRemoveSection[Fast] to remove the root section

    Fixes crash reported by Deuce when trying to iniCutSection(..., ROOT_SECTION):

    0x00000000007e9b08 in section_match (name=0x7fffffff6dd1 "Flickering...", compare=0x0, case_sensitive=true)
    at ini_file.c:95
    0x00000000007e0df0 in find_section_index (list=0x8056bebc0, section=0x0) at ini_file.c:166
    0x00000000007e167d in iniRemoveSectionFast (list=0x8056bebc0, section=0x0) at ini_file.c:452
    0x00000000007e1756 in iniCutSection (list=0x8056bebc0, section=0x0) at ini_file.c:467
    --- SBBSecho 3.29-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Mon Sep 29 02:24:34 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/48edf261f03df00cb5520067
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    Add support for root sections to iniParse and friends

    Needed by SyncTERM.

    Note, the error handling of iniParseSections() has changed somewhat... Previously, on an allocation failure, it would return whatever it
    had managed to parse so far with no indication of failure.

    Now, it returns NULL.

    Previously, NULL would be returned if there were no sections.

    Now, NULL will not be returned if there's any global comments, and
    will not be returned if there's any key/value pairs in the global
    section.
    --- SBBSecho 3.29-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Mon Sep 29 02:40:10 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/92d03abf99c1595a1b36a317
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    Move stuff around and maybe MSVC won't crash anymore?

    It looks like MSVC is just crashing in random places.
    --- SBBSecho 3.29-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Mon Sep 29 02:46:32 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/09bdfecc36d178b8c577df23
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    Bah, obviously using a variable before setting it doesn't work

    Just expand this and do it the verbose, hard-to-understand way
    because Microsoft still doesn't support C99.
    --- SBBSecho 3.29-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Mon Sep 29 02:51:44 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/aee17105432b3500c4ed1de5
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    Fine, I'll at least make the code readable...

    It's still not great due to MSVC, but at least it's not gross.
    --- SBBSecho 3.29-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Mon Sep 29 07:57:26 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/c02ffa3dbf586d1818ab4d04
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    Fix crash when there is no root section
    --- SBBSecho 3.29-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Mon Sep 29 09:34:20 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/5858834edbaf6c9f8bdd308e
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    Fix comments
    --- SBBSecho 3.29-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Mon Sep 29 11:26:04 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/afc6f520a36b00b1129fc495
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    Optimize large INI parsing some more

    Have iniParseSections() sort the section list, then use bsearch()
    to find the section.
    --- SBBSecho 3.30-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Mon Sep 29 11:38:06 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/34403c1aa40735044f4d9a2f
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    Revert "Optimize large INI parsing some more"

    This reverts commit afc6f520a36b00b1129fc49571650782e4c4cc98.
    <DigitalMan> Deuce: I don't think sysops are going to be happy about
    all the config items in SCFG be re-ordered/sorted now
    --- SBBSecho 3.30-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Mon Sep 29 11:55:34 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/3350056d0505efa6c0647b6c
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    Optimize performance: don't call strlen(prefix) needlessly in loops

    Also, if an empty/blank section prefix is passed to these functions, don't bother calling strnicmp() either.
    --- SBBSecho 3.30-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Mon Sep 29 21:32:12 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/f0c5d89c6bb6e534fd772aec
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    Right, MSVC isn't C99, no inline keyword.
    --- SBBSecho 3.30-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Mon Sep 29 21:41:10 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/0aa0eb9305c38af17d1789f1
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    Try placating Borland some more.
    --- SBBSecho 3.30-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Mon Sep 29 21:42:22 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/7a36c122e3ebe7f90a395e5d
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    Moreland.
    --- SBBSecho 3.30-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Mon Sep 29 21:44:12 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/2abc7cecd82057989ac6b665
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    Snoreland
    --- SBBSecho 3.30-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Mon Sep 29 21:52:12 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/a3625e0b9fad76ff938f0757
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    Maybe __cdecl works here?
    --- SBBSecho 3.30-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Mon Sep 29 21:55:32 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/45568d13ac9b8b5c47d7bc0e
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    Oh, I need to define this myself.
    --- SBBSecho 3.30-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Tue Sep 30 10:41:50 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/9848a07a9f84ab3a6550f87e
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    Fix valid Coverity issues.

    There's still two that are weird and I think is just Coverity
    halucination that I need to dig into a bit harder.
    --- SBBSecho 3.30-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Tue Sep 30 10:49:56 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/925310cf3e656e5fc64890bf
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    Fix the pipes.
    --- SBBSecho 3.30-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Tue Sep 30 10:59:02 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/4929df3cfb1cdc661fd3b9bb
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    Fix Coverity whinging

    Instead of a char we take the address of, make it a single-element
    array of char we pass by value (ie: the address of it).

    Same same, but Coverity should like it better.
    --- SBBSecho 3.30-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Wed Oct 1 20:19:50 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/13f7b0440c884dff072c02f7
    Modified Files:
    src/xpdev/ini_file.c
    Log Message:
    Fix Coverity fixes.

    Both of them actually worked and prevented the issue, but Coverity
    didn't know that.
    --- SBBSecho 3.30-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)