[gnome-keyring] egg-armor: Use g_strrstr_len() instead of memrchr()



commit 097089bc983ec1d25210b96a98de1fd700d09702
Author: Philip Chimento <philip chimento gmail com>
Date:   Mon Nov 14 20:40:07 2016 -0800

    egg-armor: Use g_strrstr_len() instead of memrchr()
    
    Not all systems have memrchr(), so g_strrstr_len() is more portable,
    though probably slower.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=774311

 egg/egg-armor.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/egg/egg-armor.c b/egg/egg-armor.c
index 23cfba5..267cc87 100644
--- a/egg/egg-armor.c
+++ b/egg/egg-armor.c
@@ -180,7 +180,7 @@ armor_find_end (const gchar *data,
         * does not insist that we validate this line, and is more useful
         * for PGP messages, rather than the keys we usually see.
         */
-       line = memrchr (data, '\n', (pref - 1) - data);
+       line = g_strrstr_len (data, (pref - 1) - data, "\n");
        if (line && line[1] == '=')
                pref = line;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]