mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-07-31 03:50:45 -07:00
style
This commit is contained in:
parent
f1deb865db
commit
69f8d81f4e
12 changed files with 42 additions and 43 deletions
|
@ -183,11 +183,11 @@ main_loop(char *script_cmds_file, char *script_cmd, bool pm3_present) {
|
||||||
cmd[--l] = '\0';
|
cmd[--l] = '\0';
|
||||||
}
|
}
|
||||||
// ltrim
|
// ltrim
|
||||||
size_t off=0;
|
size_t off = 0;
|
||||||
while ((cmd[off] != '\0') && isspace(cmd[off]))
|
while ((cmd[off] != '\0') && isspace(cmd[off]))
|
||||||
off++;
|
off++;
|
||||||
for (size_t i=0; i < strlen(cmd) - off; i++)
|
for (size_t i = 0; i < strlen(cmd) - off; i++)
|
||||||
cmd[i] = cmd[i+off];
|
cmd[i] = cmd[i + off];
|
||||||
cmd[strlen(cmd) - off] = '\0';
|
cmd[strlen(cmd) - off] = '\0';
|
||||||
|
|
||||||
if (cmd[0] != '\0') {
|
if (cmd[0] != '\0') {
|
||||||
|
|
|
@ -832,8 +832,7 @@ bool str_startswith(const char *s, const char *pre) {
|
||||||
bool str_endswith(const char *s, const char *suffix) {
|
bool str_endswith(const char *s, const char *suffix) {
|
||||||
size_t ls = strlen(s);
|
size_t ls = strlen(s);
|
||||||
size_t lsuffix = strlen(suffix);
|
size_t lsuffix = strlen(suffix);
|
||||||
if (ls >= lsuffix)
|
if (ls >= lsuffix) {
|
||||||
{
|
|
||||||
return strncmp(suffix, s + (ls - lsuffix), lsuffix) == 0;
|
return strncmp(suffix, s + (ls - lsuffix), lsuffix) == 0;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue