Patch Set 1: Code-Review-1

(3 comments)

https://gerrit.osmocom.org/#/c/7172/1/Transceiver52M/Transceiver.cpp
File Transceiver52M/Transceiver.cpp:

Line 672:   size_t cmd_len = strlen(cmd);
as the string of cmd is known at compile time, better pass cmd_len as param and 
use eg. sizeof("POWEROFF")-1.

BTW, this looks like a lot of code for an explicit inline function. I'd better 
mark it as static and let the compiler decide. Then better use lower caps -> 
match_cmd.


Line 731:     sscanf(params, "%d %d", &ts, &ss);
We should be checking the return value of sscanf to make sure it matches the 
amount of params expected.

Once we do that, there's no need to initialize ts and ss variables.


Line 733:     sprintf(response,"RSP HANDOVER 0 %d %d",ts,ss);
I'd use snprintf in here and all other responses. Probably you are already 
doing that in next patches.


-- 
To view, visit https://gerrit.osmocom.org/7172
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I226ca0771e63228cf5e04ef9766057d4107fdd11
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilira...@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol <pes...@sysmocom.de>
Gerrit-HasComments: Yes

Reply via email to