You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2021/03/01 10:47:52 UTC
[GitHub] [mynewt-core] sjanc commented on a change in pull request #2511: Replace strtok with strtok_r
sjanc commented on a change in pull request #2511:
URL: https://github.com/apache/mynewt-core/pull/2511#discussion_r584611967
##########
File path: hw/drivers/sensors/bno055/src/bno055_shell.c
##########
@@ -141,15 +142,15 @@ bno055_shell_cmd_sensor_offsets(int argc, char **argv)
bso.bso_gyro_off_z, bso.bso_acc_radius,
bso.bso_mag_radius);
} else if (argc == 3) {
- tok = strtok(argv[2], ":");
+ tok = strtok_r(argv[2], ":", &tok_ptr);
i = 0;
do {
val = parse_ll_bounds(tok, 0, UINT16_MAX, &rc);
if (rc) {
return bno055_shell_err_invalid_arg(argv[2]);
}
offsetdata[i] = val;
- tok = strtok(0, ":");
+ tok = strtok_r(0, ":", &tok_ptr);
Review comment:
make it NULL instead of 0
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org