Skip to content

Commit

Permalink
Tweak some indentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wayne Davison committed Apr 6, 2020
1 parent 7f06cc7 commit 8475e0e
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 39 deletions.
12 changes: 6 additions & 6 deletions authenticate.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,12 @@ void auth_client(int fd, const char *user, const char *challenge)
/* XXX: cyeoh says that getpass is deprecated, because
* it may return a truncated password on some systems,
* and it is not in the LSB.
*
* Andrew Klein says that getpassphrase() is present
* on Solaris and reads up to 256 characters.
*
* OpenBSD has a readpassphrase() that might be more suitable.
*/
*
* Andrew Klein says that getpassphrase() is present
* on Solaris and reads up to 256 characters.
*
* OpenBSD has a readpassphrase() that might be more suitable.
*/
pass = getpass("Password: ");
}

Expand Down
32 changes: 15 additions & 17 deletions checksum.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ int csum_len_for_type(int cst, BOOL flist_csum)

int canonical_checksum(int csum_type)
{
return csum_type >= CSUM_MD4 ? 1 : 0;
return csum_type >= CSUM_MD4 ? 1 : 0;
}

/*
Expand All @@ -105,20 +105,19 @@ int canonical_checksum(int csum_type)
*/
uint32 get_checksum1(char *buf1, int32 len)
{
int32 i;
uint32 s1, s2;
schar *buf = (schar *)buf1;

s1 = s2 = 0;
for (i = 0; i < (len-4); i+=4) {
s2 += 4*(s1 + buf[i]) + 3*buf[i+1] + 2*buf[i+2] + buf[i+3] +
10*CHAR_OFFSET;
s1 += (buf[i+0] + buf[i+1] + buf[i+2] + buf[i+3] + 4*CHAR_OFFSET);
}
for (; i < len; i++) {
s1 += (buf[i]+CHAR_OFFSET); s2 += s1;
}
return (s1 & 0xffff) + (s2 << 16);
int32 i;
uint32 s1, s2;
schar *buf = (schar *)buf1;

s1 = s2 = 0;
for (i = 0; i < (len-4); i+=4) {
s2 += 4*(s1 + buf[i]) + 3*buf[i+1] + 2*buf[i+2] + buf[i+3] + 10*CHAR_OFFSET;
s1 += (buf[i+0] + buf[i+1] + buf[i+2] + buf[i+3] + 4*CHAR_OFFSET);
}
for (; i < len; i++) {
s1 += (buf[i]+CHAR_OFFSET); s2 += s1;
}
return (s1 & 0xffff) + (s2 << 16);
}

void get_checksum2(char *buf, int32 len, char *sum)
Expand Down Expand Up @@ -228,8 +227,7 @@ void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum)
mdfour_begin(&m);

for (i = 0; i + CSUM_CHUNK <= len; i += CSUM_CHUNK) {
mdfour_update(&m, (uchar *)map_ptr(buf, i, CSUM_CHUNK),
CSUM_CHUNK);
mdfour_update(&m, (uchar *)map_ptr(buf, i, CSUM_CHUNK), CSUM_CHUNK);
}

/* Prior to version 27 an incorrect MD4 checksum was computed
Expand Down
2 changes: 1 addition & 1 deletion generator.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ static int need_retouch_dir_perms;
static const char *solo_file = NULL;

enum nonregtype {
TYPE_DIR, TYPE_SPECIAL, TYPE_DEVICE, TYPE_SYMLINK
TYPE_DIR, TYPE_SPECIAL, TYPE_DEVICE, TYPE_SYMLINK
};

/* Forward declarations. */
Expand Down
4 changes: 2 additions & 2 deletions log.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ static int64 initial_data_written;
static int64 initial_data_read;

struct {
int code;
char const *name;
int code;
char const *name;
} const rerr_names[] = {
{ RERR_SYNTAX , "syntax or usage error" },
{ RERR_PROTOCOL , "protocol incompatibility" },
Expand Down
2 changes: 1 addition & 1 deletion options.c
Original file line number Diff line number Diff line change
Expand Up @@ -1804,7 +1804,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
* of any more restrictive ACLs, but this is safe
* for now */
snprintf(err_buf,sizeof(err_buf),
"ACLs are not supported on this %s\n",
"ACLs are not supported on this %s\n",
am_server ? "server" : "client");
return 0;
#endif
Expand Down
10 changes: 5 additions & 5 deletions rounding.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
#define SIZEOF(x) ((long int)sizeof (x))

struct test {
union file_extras extras[ARRAY_LEN];
struct file_struct file;
union file_extras extras[ARRAY_LEN];
struct file_struct file;
};

#define ACTUAL_SIZE SIZEOF(struct test)
#define EXPECTED_SIZE (SIZEOF(union file_extras) * ARRAY_LEN + SIZEOF(struct file_struct))

int main(UNUSED(int argc), UNUSED(char *argv[]))
{
static int test_array[1 - 2 * (ACTUAL_SIZE != EXPECTED_SIZE)];
test_array[0] = 0;
return 0;
static int test_array[1 - 2 * (ACTUAL_SIZE != EXPECTED_SIZE)];
test_array[0] = 0;
return 0;
}
4 changes: 2 additions & 2 deletions uidlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ extern char *groupmap;
#define NFLAGS_NAME_MATCH (1<<1)

union name_or_id {
const char *name;
id_t max_id;
const char *name;
id_t max_id;
};

struct idlist {
Expand Down
10 changes: 5 additions & 5 deletions util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1523,8 +1523,8 @@ uint32 fuzzy_distance(const char *s1, unsigned len1, const char *s2, unsigned le
#define BB_PER_SLOT_INTS (BB_SLOT_SIZE / 4) /* Number of int32s per slot */

struct bitbag {
uint32 **bits;
int slot_cnt;
uint32 **bits;
int slot_cnt;
};

struct bitbag *bitbag_create(int max_ndx)
Expand Down Expand Up @@ -1687,7 +1687,7 @@ void *expand_item_list(item_list *lp, size_t item_size,
/* This zeroing of memory won't be optimized away by the compiler. */
void force_memzero(void *buf, size_t len)
{
volatile uchar *z = buf;
while (len-- > 0)
*z++ = '\0';
volatile uchar *z = buf;
while (len-- > 0)
*z++ = '\0';
}

0 comments on commit 8475e0e

Please sign in to comment.