diff options
author | Ben Brewer <ben.brewer@codethink.co.uk> | 2014-05-29 11:44:45 +0100 |
---|---|---|
committer | Ben Brewer <ben.brewer@codethink.co.uk> | 2014-06-02 11:03:00 +0100 |
commit | 9bb191462e637bc97b6bcbcfe798cc254ba7a7e4 (patch) | |
tree | 0a3804c055cb396eabf49f27c5f02f0dac65a4b5 /tbdiff/tbdiff-create.c | |
parent | e9344787030b3ba052db9f79462ffa5da3a0ee32 (diff) | |
download | tbdiff-9bb191462e637bc97b6bcbcfe798cc254ba7a7e4.tar.gz |
Create tbd_cmd_t type to for commands and use sizeof in write
Previously commands were just treated as a uint8_t and given the value of
and enum. This is now made more clear in the code by defining tbd_cmd_t as
a uint8_t below the enum in tbdiff-common.h.
Diffstat (limited to 'tbdiff/tbdiff-create.c')
-rw-r--r-- | tbdiff/tbdiff-create.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tbdiff/tbdiff-create.c b/tbdiff/tbdiff-create.c index 21738a5..873f6ee 100644 --- a/tbdiff/tbdiff-create.c +++ b/tbdiff/tbdiff-create.c @@ -33,10 +33,10 @@ #define PATH_BUFFER_LENGTH 4096 static int -tbd_create_fwrite_cmd(FILE *stream, - uint8_t cmd) +tbd_create_fwrite_cmd(FILE *stream, + tbd_cmd_t cmd) { - if(fwrite(&cmd, 1, 1, stream) != 1) + if(fwrite(&cmd, sizeof(tbd_cmd_t), 1, stream) != 1) return TBD_ERROR(TBD_ERROR_UNABLE_TO_WRITE_STREAM); return 0; } |