diff --git a/src/DAAP2SQL.g b/src/DAAP2SQL.g index 93e9a428..1fcbf12f 100644 --- a/src/DAAP2SQL.g +++ b/src/DAAP2SQL.g @@ -252,7 +252,7 @@ expr returns [ pANTLR3_STRING result, int valid ] val[0] = '\%'; } - if (val[strlen((char *)val) - 1] == '*') + if (val[0] && val[1] && val[strlen((char *)val) - 1] == '*') { op = '\%'; val[strlen((char *)val) - 1] = '\%';