cppcheck: Simplify empty string test without using strlen()
[lttng-tools.git] / src / bin / lttng / commands / enable_events.c
index b6c18e142ca6c3e7434e616db17f3499df636d45..73c9e05209316cb99045a9cc0d744ddd349f83ae 100644 (file)
@@ -199,7 +199,7 @@ static int parse_probe_opts(struct lttng_event *ev, char *opt)
                strncpy(ev->attr.probe.symbol_name, name, LTTNG_SYMBOL_NAME_LEN);
                ev->attr.probe.symbol_name[LTTNG_SYMBOL_NAME_LEN - 1] = '\0';
                DBG("probe symbol %s", ev->attr.probe.symbol_name);
-               if (strlen(s_hex) == 0) {
+               if (*s_hex == '\0') {
                        ERR("Invalid probe offset %s", s_hex);
                        ret = -1;
                        goto end;
@@ -227,7 +227,7 @@ static int parse_probe_opts(struct lttng_event *ev, char *opt)
        /* Check for address */
        ret = sscanf(opt, "%s", s_hex);
        if (ret > 0) {
-               if (strlen(s_hex) == 0) {
+               if (*s_hex == '\0') {
                        ERR("Invalid probe address %s", s_hex);
                        ret = -1;
                        goto end;
This page took 0.023292 seconds and 4 git commands to generate.