[Rpm-maint] [rpm-software-management/rpm] Convert variable length arrays to C++ strings and vectors (PR #4113)

Michal Domonkos notifications at github.com
Wed Feb 25 08:38:40 UTC 2026


@dmnks commented on this pull request.



> @@ -18,21 +20,16 @@ int rpmvercmp(const char * a, const char * b)
     /* easy comparison to see if versions are identical */
     if (rstreq(a, b)) return 0;
 
-    char oldch1, oldch2;
-    char abuf[strlen(a)+1], bbuf[strlen(b)+1];
-    char *str1 = abuf, *str2 = bbuf;
-    char * one, * two;
+    std::string abuf(a);
+    std::string bbuf(b);
+    char *str1 = abuf.data(), *str2 = bbuf.data();

Yep, that explains it :+1: I was only looking at that other page which apparently only documents C++11 and older :sweat_smile: 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/4113#discussion_r2851611248
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/4113/review/3852680376 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20260225/acc41aed/attachment.htm>


More information about the Rpm-maint mailing list