head 1.2; access; symbols pkgsrc-2025Q2:1.1.0.2 pkgsrc-2025Q2-base:1.1; locks; strict; comment @// @; 1.2 date 2025.08.03.09.49.35; author wiz; state dead; branches; next 1.1; commitid 7V0vJbdiOjKkEg5G; 1.1 date 2025.04.28.20.44.38; author tnn; state Exp; branches; next ; commitid rAowavxfkb1eoRSF; desc @@ 1.2 log @zxcvbn-c: update to 2.6. This release is to include several fixes: Fix compile errors when using LLVM or GCC15. Update install makefile rules used in RPM installs. Some fixed arrays weren't being declared const. Potential problem with parallel builds. @ text @$NetBSD: patch-dict-generate.cpp,v 1.1 2025/04/28 20:44:38 tnn Exp $ * https://github.com/tsyrogit/zxcvbn-c/commit/b9f30993c88d9057d7d95a1b059989f7853fd1b0 * https://github.com/tsyrogit/zxcvbn-c/commit/92c6ea875231876ca264187326ce2d615d5ad543 --- dict-generate.cpp.orig 2025-04-28 20:39:40.248646721 +0000 +++ dict-generate.cpp @@@@ -22,6 +22,8 @@@@ * **********************************************************************************/ +#include +#include #include #include #include @@@@ -387,7 +389,7 @@@@ typedef map EntryMap_t; typedef list StringList_t; typedef list NodeList_t; typedef set StringIntSet_t; -typedef basic_string StringOfInts; +typedef vector StringOfInts; typedef vector UintVect; typedef vector Uint64Vect; typedef vector StrIntPtrVect_t; @@@@ -601,17 +603,14 @@@@ static void ScanTrieForOrder(EntryMap_t static void ReduceTrie(NodeSPtr Root) { int Height; - int cnt=0, del=0; Root->CalcCheck(); NodeSPtr pNode = Root; for(Height = Root->CalcHeight(); Height >= 0; --Height) { // Get a list of all nodes at given height - int x=0; NodeList_t Lst; AddToListAtHeight(Lst, Root, Height); - cnt += Lst.size(); NodeList_t::iterator Ita, Itb; for(Ita = Lst.begin(); Ita != Lst.end(); ++Ita) @@@@ -631,7 +630,6 @@@@ static void ReduceTrie(NodeSPtr Root) // Remove the 2nd node from the scanning list to as it will // get deleted by the sharing (as using std::shared_ptr) Parentb->ChangeChild(*Ita, *Itb); - ++x;++del; Itb = Lst.erase(Itb); } else @@@@ -741,7 +739,7 @@@@ static int CheckReduction(StringIntVect_ { char Tmp[20]; Ranks[b].i = It->second.mRank; - sprintf(Tmp, "%d: ", n); + snprintf(Tmp, sizeof(Tmp), "%d: ", n); Ranks[b].s = string(Tmp) + Text; } // Try to find a non-existant word @@@@ -868,15 +866,14 @@@@ void CreateArrays(NodeSPtr Root, StringI for(Itc = Root->ChildBegin(); Itc != Root->ChildEnd(); ++Itc) { int i = Itc->second->GetAddr(); - Chld += i; + Chld.push_back(i); } // Find where in pointer array the child pointer string is - StringOfInts::size_type x = ChildAddrs.find(Chld); - if (x == StringOfInts::npos) + StringOfInts::size_type x = search(ChildAddrs.begin(), ChildAddrs.end(), Chld.begin(), Chld.end()) - ChildAddrs.begin(); + if (x == ChildAddrs.size()) { // Not found, add it - x = ChildAddrs.length(); - ChildAddrs += Chld; + ChildAddrs.insert(ChildAddrs.end(), Chld.begin(), Chld.end()); } // Val will contain the final node data uint64_t Val = Its->i; @ 1.1 log @zxcvbn-c: add some build fixes from upstream for GCC 15 and make -j @ text @d1 1 a1 1 $NetBSD$ @