Merge lp:~osmoma/audio-recorder/trunk into lp:audio-recorder

Proposed by moma
Status: Merged
Approved by: moma
Approved revision: 1441
Merged at revision: 1441
Proposed branch: lp:~osmoma/audio-recorder/trunk
Merge into: lp:audio-recorder
Diff against target: 25 lines (+14/-1)
1 file modified
src/utility.c (+14/-1)
To merge this branch: bzr merge lp:~osmoma/audio-recorder/trunk
Reviewer Review Type Date Requested Status
moma Approve
Review via email: mp+372286@code.launchpad.net

Commit message

Fixing bug #1838710 in str_compare() function. Thanks to Chipschap and Roy.

To post a comment you must log in.
Revision history for this message
moma (osmoma) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/utility.c'
2--- src/utility.c 2019-03-08 17:25:19 +0000
3+++ src/utility.c 2019-09-04 18:07:33 +0000
4@@ -1046,7 +1046,20 @@
5 }
6
7 gint str_compare(const gchar *s1, const gchar *s2, gboolean case_insensitive) {
8- if (*s1 == '\0' && *s2 == '\0') {
9+
10+ if (s1 == NULL && s2 == NULL) {
11+ // Assume equals
12+ return 0;
13+ } else if (s1 == NULL) {
14+ // s1 < s2
15+ return -1;
16+ } else if (s2 == NULL) {
17+ // s1 > s2
18+ return 1;
19+ }
20+
21+ // Here both are valid (not NULL) strings
22+ if (*s1 == '\0' && s2 == '\0') {
23 // Equals
24 return 0;
25 }

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: