Menu

#75 Fixed potential infinite loop and made string utilities more modular. Also added a utility function for copying strings that are not null-terminated.

Unstable (example)
open
nobody
5
2019-12-09
2019-04-26
Jim Monte
No

If an error code was returned while formatting a string, the buffer was doubled in size and the formatting was retried until there was no error. However, if there was a formatting error the previous time, it will persist with a larger buffer causing an infinte loop.

1 Attachments

Discussion

  • Jim Monte

    Jim Monte - 2019-12-06

    Actually it woulid not be an infinite loop since the memory allocation would eventually fail.

     
  • Jim Monte

    Jim Monte - 2019-12-09

    The code for this patch along with several string utilities that were added for use later, such as a substring search using the Rabin-Karp algorithm, are available in branch beta_jdm.

    ```
    commit 595c0249689cf33ce6408b3899f560e72d251a9a
    Date: Mon, 9 Dec 2019 00:27:03 -0500

    Fixed buffer resizing, made string utilities more modular, and added several new utilities, some which do not require a null termination, potentially avoiding the need to copy a string. Also some substring utilities using the Rabin-Karp algorithm were added.
    

    ```

    Builds of ngspice succeeded in Windows with Visual Studio, MinGW, and Cygwin and in Linux using GCC. In Windows with Cygwin, make check indicated all passes, and in Linux the paranoia test suite passed, except for the same three tests that failed earlier.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.