Whoops! Thanks. Apparently I only tested it on cases that either had content (non-whitespace) from the beginning of the string, or was an empty string (""). Silly. Patch here:

https://sourceforge.net/p/liferea/bugs/1069/?limit=10&page=1#46c9

Also noted another thing that was bad (in such a small, simple function) after I wrote a unit test. Should do more of those. :)

Regards, Simon


On Sat, May 18, 2013 at 6:17 PM, Lars Windolf <lars.lindner@gmail.com> wrote:
Damn. Right!

Thanks for reviewing!

Best Regards,
Lars


On Sat, May 18, 2013 at 6:07 PM, Emilio Pozuelo Monfort <pochu27@gmail.com> wrote:
Hi Lars!


On 18/05/13 17:51, Lars Windolf wrote:
+gboolean
+common_str_is_empty (const gchar *s)
+{
+       g_return_val_if_fail (s != NULL, TRUE);
+
+       while (*s != '\0') {
+               if (!g_ascii_isspace (*s))
+                       return FALSE;
+       }
+
+       return TRUE;
+}

Can't this lead to an infinite loop? Looks to me like there should be an 's++;' inside the while loop.

Regards,
Emilio


------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Liferea-devel mailing list
Liferea-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/liferea-devel