libtasn1 | Use streq instead of strcmp (!125)
Read-only notification of GnuTLS library development activities <[email protected]> Mon, 30 Mar 2026 01:25:03 +0000
| Newsgroups | gmane.comp.encryption.gpg.gnutls.devel |
|---|---|
| Message-ID | <[email protected]> |
Daiki Ueno created a merge request: https://gitlab.com/gnutls/libtasn1/-/merge_requests/125
Project:Branches: dueno/libtasn1:wip/streq to gnutls/libtasn1:master
Author: Daiki Ueno
Checking equality of strings with strcmp is error prone and Gnulib
provides streq function to avoid that. Switch to using it as well as
enable sc_prohibit_strcmp syntax check at build time.
The rewrite is mostly done with the following sed command:
```
sed -i -e 's/!strcmp (\([^,]*\), \([^)]*\))/streq (\1, \2)/g' \
-e 's/strcmp (\([^,]*\), \([^)]*\)) == 0/streq (\1, \2)/g' \
-e 's/!(strcmp (\([^,]*\), \([^)]*\)))/streq (\1, \2)/g' \
$(git grep -l -w strcmp lib/ src/)
```
## Checklist
* [ ] Code modified for feature
* [ ] Test suite updated with functionality tests
* [ ] Test suite updated with negative tests
* [ ] Documentation updated
## Reviewer's checklist:
* [ ] There is a test suite reasonably covering new functionality or modifications
* [ ] Function naming, parameters, return values, types, etc., are consistent with other code
* [ ] This feature/change has adequate documentation added
* [ ] No obvious mistakes in the code
--
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/libtasn1/-/merge_requests/125
You're receiving this email because of your account on gitlab.com. Unsubscribe from this thread: https://gitlab.com/-/sent_notifications/4-acvgusg61da15qlxlj1iyfyzy-aht8b/unsubscribe | Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help
_______________________________________________
Gnutls-devel mailing list
[email protected]
http://lists.gnupg.org/mailman/listinfo/gnutls-devel