summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2020-04-07 13:14:53 +0200
committerDave Davenport <qball@gmpclient.org>2020-04-07 13:14:53 +0200
commitde38e0f4a9c2e4dce9d2ab764359f62610f0f17a (patch)
tree12c15466c8688570978554634911fa0e830d05c7
parent34a278f943042084ee318e0fb059040643b9965a (diff)
[Script|Dmenu] Don't -1 in a unsigned variable.
-rw-r--r--source/dialogs/script.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/dialogs/script.c b/source/dialogs/script.c
index 1991ac3e..6976fe05 100644
--- a/source/dialogs/script.c
+++ b/source/dialogs/script.c
@@ -81,7 +81,7 @@ void dmenuscript_parse_entry_extras ( G_GNUC_UNUSED Mode *sw, DmenuScriptEntry *
length_key++;
}
// Should be not last character in buffer.
- if ( length_key < (length-1) ) {
+ if ( (length_key+1) < (length) ) {
buffer[length_key] = '\0';
char *value = buffer + length_key + 1;
if ( strcasecmp ( buffer, "icon" ) == 0 ) {
@@ -104,7 +104,7 @@ static void parse_header_entry ( Mode *sw, char *line, ssize_t length )
{
ScriptModePrivateData *pd = (ScriptModePrivateData *) sw->private_data;
ssize_t length_key = 0;//strlen ( line );
- while ( length_key <= length && line[length_key] != '\x1f' ) {
+ while ( length_key < length && line[length_key] != '\x1f' ) {
length_key++;
}