Remove redundant c_str #4206

pull rebroad wants to merge 1 commits into bitcoin:master from rebroad:RemoveRedundantC_str changing 7 files +15 −15
  1. rebroad commented at 11:09 AM on May 21, 2014: contributor

    Found some more...

  2. Remove redundant c_str 79d06dc6e0
  3. in src/init.cpp:None in 169643dbc1 outdated
     913 | @@ -914,7 +914,7 @@ bool AppInit2(boost::thread_group& threadGroup)
     914 |          for (map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.begin(); mi != mapBlockIndex.end(); ++mi)
     915 |          {
     916 |              uint256 hash = (*mi).first;
     917 | -            if (strncmp(hash.ToString().c_str(), strMatch.c_str(), strMatch.size()) == 0)
    


    sipa commented at 11:32 AM on May 21, 2014:

    strncmp is a C function, which requires C strings.


    laanwj commented at 11:48 AM on May 21, 2014:

    Right, this shouldn't even build


    laanwj commented at 12:38 PM on May 21, 2014:

    Seems like you could use boost::starts_with here instead. Personally I think that'd be cleaner than using a C function on two C++ strings.

  4. BitcoinPullTester commented at 5:41 PM on May 21, 2014: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/79d06dc6e07103b31b530f71b7187ea82c34266b for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  5. laanwj commented at 8:01 AM on May 23, 2014: member

    ACK on code changes + tested that -printblock still works as expected

  6. laanwj merged this on May 25, 2014
  7. laanwj closed this on May 25, 2014

  8. laanwj referenced this in commit 73f7153f43 on May 25, 2014
  9. 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-22 18:15 UTC

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