Skip to content

Commit b45f3e1

Browse files
committed
Fixed topic name length check
1 parent 80851e8 commit b45f3e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mqtt-sn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ void mqtt_sn_register_topic(int topic_id, const char* topic_name)
420420
}
421421

422422
// Check topic name is valid
423-
if (topic_name == NULL || strlen(topic_name) < 0) {
423+
if (topic_name == NULL || strlen(topic_name) <= 0) {
424424
fprintf(stderr, "Error: attempted to register invalid topic name.\n");
425425
return;
426426
}

0 commit comments

Comments
 (0)