Use vector::data() instead of &vch[0] in base58.cpp #10790

pull meshcollider wants to merge 1 commits into bitcoin:master from meshcollider:prefer-vector-data changing 2 files +7 −7
  1. meshcollider commented at 3:23 AM on July 11, 2017: contributor

    &vch[0] has undefined behavior for empty vectors, c++11 introduced data() as a safer alternative

    EncodeBase58(const std::vector<unsigned char>& vch) didn't check for empty vectors before using &vch[0] so suggest replacing with data() in this file, also makes it consistent with base58_tests.cpp

  2. Prefer vch.data() over &vch[0]in base58 0e0bc80cbc
  3. laanwj added the label Refactoring on Jul 11, 2017
  4. laanwj commented at 7:18 AM on July 11, 2017: member

    Have you checked that this doesn't overlap with #9804? If it does, please review that one instead.

  5. meshcollider commented at 8:16 AM on July 11, 2017: contributor

    Ah it does, missed that sorry. Closing this then.

  6. meshcollider closed this on Jul 11, 2017

  7. meshcollider deleted the branch on Jul 11, 2017
  8. DrahtBot locked this on Sep 8, 2021
Contributors

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:15 UTC

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