/* 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: ");
}
int canonical_checksum(int csum_type)
{
- return csum_type >= CSUM_MD4 ? 1 : 0;
+ return csum_type >= CSUM_MD4 ? 1 : 0;
}
/*
*/
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)
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
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. */
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" },
* 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
#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)
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;
}
#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 {
#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)
/* 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';
}