diff --git a/sw/airborne/subsystems/datalink/telemetry.c b/sw/airborne/subsystems/datalink/telemetry.c index f172d6105c..1bc2d62f71 100644 --- a/sw/airborne/subsystems/datalink/telemetry.c +++ b/sw/airborne/subsystems/datalink/telemetry.c @@ -35,7 +35,7 @@ * @param _cb callback function, called according to telemetry mode and specified period * @return TRUE if message registered with success, FALSE otherwise */ -bool_t register_periodic_telemetry(struct pprz_telemetry * _pt, char * _msg, telemetry_cb _cb) { +bool_t register_periodic_telemetry(struct pprz_telemetry * _pt, const char * _msg, telemetry_cb _cb) { // look for message name uint8_t i; for (i = 0; i < _pt->nb; i++) { diff --git a/sw/airborne/subsystems/datalink/telemetry_common.h b/sw/airborne/subsystems/datalink/telemetry_common.h index 30aaf3e0e0..96cf09dc46 100644 --- a/sw/airborne/subsystems/datalink/telemetry_common.h +++ b/sw/airborne/subsystems/datalink/telemetry_common.h @@ -58,7 +58,7 @@ struct pprz_telemetry { * @param _cb callback function, called according to telemetry mode and specified period * @return TRUE if message registered with success, FALSE otherwise */ -extern bool_t register_periodic_telemetry(struct pprz_telemetry * _pt, char * _msg, telemetry_cb _cb); +extern bool_t register_periodic_telemetry(struct pprz_telemetry * _pt, const char * _msg, telemetry_cb _cb); #if USE_PERIODIC_TELEMETRY_REPORT /** Send an error report when trying to send message that as not been register diff --git a/sw/include/std.h b/sw/include/std.h index ca3cb52640..60a2ee85f0 100644 --- a/sw/include/std.h +++ b/sw/include/std.h @@ -239,10 +239,11 @@ typedef uint8_t unit_t; } \ } -static inline bool_t str_equal(char * a, char * b) { - while (!(*a == 0 && *b == 0)) { - if (*a != *b) return FALSE; - a++; b++; +static inline bool_t str_equal(const char * a, const char * b) { + int i = 0; + while (!(a[i] == 0 && b[i] == 0)) { + if (a[i] != b[i]) return FALSE; + i++; } return TRUE; }