Skip to content

Commit

Permalink
Merge pull request #129 from CDKnightNASA/fix-128-strncpy_null_term
Browse files Browse the repository at this point in the history
Fix #128, strncpy should result in null term
  • Loading branch information
yammajamma authored Sep 3, 2020
2 parents bafd03b + 446179d commit ec54b1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Subsystems/cmdUtil/cmdUtil.c
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ int main(int argc, char *argv[])
}

/* Copy the data over (zero fills) */
strncpy(sbuf, &tail[1], sizeof(sbuf));
strncpy(sbuf, &tail[1], sizeof(sbuf) - 1);
CopyData(cmd.Packet, &startbyte, sbuf, tempull);

/* Reset tail so it doesn't trigger error */
Expand Down

0 comments on commit ec54b1a

Please sign in to comment.