summaryrefslogtreecommitdiffstats
path: root/source/dialogs/script.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/dialogs/script.c')
-rw-r--r--source/dialogs/script.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/dialogs/script.c b/source/dialogs/script.c
index db5e6c96..1991ac3e 100644
--- a/source/dialogs/script.c
+++ b/source/dialogs/script.c
@@ -77,10 +77,11 @@ typedef struct
void dmenuscript_parse_entry_extras ( G_GNUC_UNUSED Mode *sw, DmenuScriptEntry *entry, char *buffer, size_t length )
{
size_t length_key = 0; //strlen ( line );
- while ( length_key <= length && buffer[length_key] != '\x1f' ) {
+ while ( length_key < length && buffer[length_key] != '\x1f' ) {
length_key++;
}
- if ( length_key < length ) {
+ // Should be not last character in buffer.
+ if ( length_key < (length-1) ) {
buffer[length_key] = '\0';
char *value = buffer + length_key + 1;
if ( strcasecmp ( buffer, "icon" ) == 0 ) {