[markup] Stop recomputing len, use slen

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-05-30 07:52:29 +02:00
parent b0710a0c03
commit e39bb8eac6
2 changed files with 6 additions and 6 deletions

View file

@ -760,7 +760,7 @@ client_markup_parse(client_t *c, const char *str, ssize_t len)
/** Kill a client via a WM_DELETE_WINDOW request or XKillClient if not
* supported.
* \param c the client to kill
* \param c The client to kill,
*/
void
client_kill(client_t *c)

View file

@ -207,10 +207,10 @@ markup_parser_data_delete(markup_parser_data_t **p)
}
/** Parse markup defined in data on the string str.
* \param data a markup_parser_data_t allocated by markup_parser_data_new()
* \param str a string to parse markup from
* \param slen str length
* \return true if success, false otherwise
* \param data A markup_parser_data_t allocated by markup_parser_data_new().
* \param str A string to parse markup from.
* \param slen String length.
* \return True if success, false otherwise.
*/
bool
markup_parse(markup_parser_data_t *data, const char *str, ssize_t slen)
@ -231,7 +231,7 @@ markup_parse(markup_parser_data_t *data, const char *str, ssize_t slen)
};
GError *error = NULL;
if(!a_strlen(str))
if(slen <= 0)
return false;
mkp_ctx = g_markup_parse_context_new(&parser, 0, data, NULL);