aboutsummaryrefslogtreecommitdiff
path: root/bp.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-01-18 11:28:39 -0800
committerBruce Hill <bruce@bruce-hill.com>2021-01-18 11:28:39 -0800
commit0b0e99bfac8e11463ae15211882aab98ba150dcb (patch)
treebbcce8c175438e8f6152207c9cd9099942230b2f /bp.c
parente98574570ec0e355c6cff2b6e30bd992f20fe610 (diff)
A few more pedantic cleanups
Diffstat (limited to 'bp.c')
-rw-r--r--bp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/bp.c b/bp.c
index ea6360c..b9e5eb5 100644
--- a/bp.c
+++ b/bp.c
@@ -132,8 +132,8 @@ static int is_text_file(const char *filename)
{
int fd = open(filename, O_RDONLY);
if (fd < 0) return 0;
- unsigned char buf[64];
- ssize_t len = read(fd, buf, sizeof(buf)/sizeof(unsigned char));
+ char buf[64];
+ ssize_t len = read(fd, buf, sizeof(buf)/sizeof(char));
if (len < 0) return 0;
(void)close(fd);
@@ -264,7 +264,7 @@ static void confirm_replacements(file_t *f, match_t *m, confirm_t *confirm)
//
static int inplace_modify_file(def_t *defs, file_t *f, pat_t *pattern)
{
- char tmp_filename[PATH_MAX+1] = {0};
+ char tmp_filename[PATH_MAX+1] = {'\0'};
printer_t pr = {
.file = f,
.context_lines = ALL_CONTEXT,
@@ -396,7 +396,7 @@ static int process_dir(def_t *defs, const char *dirname, pat_t *pattern)
{
int matches = 0;
glob_t globbuf;
- char globpath[PATH_MAX+1] = {0};
+ char globpath[PATH_MAX+1] = {'\0'};
check(snprintf(globpath, PATH_MAX, "%s/*", dirname) <= (int)PATH_MAX,
"Filename is too long: %s/*", dirname);
int status = glob(globpath, 0, NULL, &globbuf);