get rid of strlcpy.h #1901

pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2012_10_remove_strlcpy changing 7 files +30 −129
  1. laanwj commented at 7:56 PM on October 2, 2012: member

    Don't use hand-rolled string manipulation routine with a fixed buffer in the bitcoin core, instead make use of c++ strings and boost high-level string algorithms.

  2. in src/irc.cpp:None in a85bb5af93 outdated
     324 | @@ -324,27 +325,24 @@ void ThreadIRCSeed2(void* parg)
     325 |              if (vWords.size() < 2)
     326 |                  continue;
     327 |  
     328 | -            char pszName[10000];
     329 | -            pszName[0] = '\0';
     330 | +            std::string pszName;
    


    gavinandresen commented at 8:06 PM on October 2, 2012:

    "psz" prefix means pointer-to-string-terminated-with-zero. Should be strName if we want to keep using type prefixes...


    Diapolo commented at 8:18 PM on October 2, 2012:

    I had to smile ^^, sorry (I guess @laanwj tried to avoid the mostly hated variable renaming).


    laanwj commented at 8:19 PM on October 2, 2012:

    Ok, will change those to str

  3. laanwj commented at 4:53 AM on October 3, 2012: member

    They're str* now

    (interesting bit of oversight here, those psz* prefixes are to me like funny variable names, didn't even think for one second that they had meaning about the type. A possible relation between types and variable names just doesn't fit into my head :-) )

  4. BitcoinPullTester commented at 9:17 AM on October 6, 2012: none

    Automatic sanity-testing: FAILED BUILD/TEST, see http://jenkins.bluematt.me/pull-tester/416279c3a82f2ef13d3c7dab368e1f139ec950b9 for binaries and test log.

    This could happen for one of several reasons:

    1. It chanages paths in makefile.linux-mingw or otherwise changes build scripts in a way that made them incompatible with the automated testing scripts
    2. It does not build on either Linux i386 or Win32 (via MinGW cross compile)
    3. The test suite fails on either Linux i386 or Win32
    4. The block test-cases failed (lookup the first bNN identifier which failed in https://github.com/TheBlueMatt/test-scripts/blob/master/FullBlockTestGenerator.java)
  5. laanwj commented at 9:43 AM on October 6, 2012: member

    Seems that the windows build needed some boost headers headers in util.cpp:

    util.cpp: In function 'void ParseParameters(int, const char* const*)':
    util.cpp:510: error: 'to_lower' is not a member of 'boost'
    util.cpp:511: error: 'starts_with' is not a member of 'boost::algorithm'
    

    Fixed, cross compile works again.

  6. sipa commented at 12:35 PM on October 7, 2012: member

    Can you also remove strlcpy.h from doc/assets-attribution.txt?

  7. get rid of strlcpy.h
    Don't use hand-rolled string manipulation routine with a fixed
    buffer in the bitcoin core, instead make use of c++ strings and boost.
    6032e4f4e7
  8. laanwj commented at 12:39 PM on October 7, 2012: member

    Done

  9. sipa commented at 12:52 PM on October 7, 2012: member

    ACK

  10. jgarzik commented at 10:10 PM on October 8, 2012: contributor

    ACK

  11. laanwj referenced this in commit ac0ad5dc63 on Oct 11, 2012
  12. laanwj merged this on Oct 11, 2012
  13. laanwj closed this on Oct 11, 2012

  14. laanwj deleted the branch on Apr 9, 2014
  15. KolbyML referenced this in commit 443318460f on Dec 5, 2020
  16. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me