Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Low: "char *" more string funcs friendly than unsigned variant
Also make use of typedef'd boothc_site.
  • Loading branch information
jnpkrn committed Apr 11, 2016
commit 1dcd750cfd3297f93de3df6fd31f0fce1c0ea3e8
10 changes: 5 additions & 5 deletions src/booth.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@
#define TICKET_LOST CHAR2CONST('L', 'O', 'S', 'T')


typedef unsigned char boothc_site [BOOTH_NAME_LEN];
typedef unsigned char boothc_ticket[BOOTH_NAME_LEN];
typedef unsigned char boothc_attr[BOOTH_NAME_LEN];
typedef unsigned char boothc_attr_value[BOOTH_ATTRVAL_LEN];
typedef char boothc_site[BOOTH_NAME_LEN];
typedef char boothc_ticket[BOOTH_NAME_LEN];
typedef char boothc_attr[BOOTH_NAME_LEN];
typedef char boothc_attr_value[BOOTH_ATTRVAL_LEN];

/* message option bits */
enum {
Expand Down Expand Up @@ -290,7 +290,7 @@ struct booth_site {
/** Roles, like ACCEPTOR, PROPOSER, or LEARNER. Not really used ATM. */
int role;

char addr_string[BOOTH_NAME_LEN];
boothc_site addr_string;

int tcp_fd;
int udp_fd;
Expand Down
2 changes: 1 addition & 1 deletion src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ static int get_other_site(struct booth_site **node)
}


int find_site_by_name(unsigned char *site, struct booth_site **node, int any_type)
int find_site_by_name(char *site, struct booth_site **node, int any_type)
{
struct booth_site *n;
int i;
Expand Down
4 changes: 2 additions & 2 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ struct booth_config {
/** File containing the authentication file. */
char authfile[BOOTH_PATH_LEN];
struct stat authstat;
unsigned char authkey[BOOTH_MAX_KEY_LEN];
char authkey[BOOTH_MAX_KEY_LEN];
int authkey_len;
/** Maximum time skew between peers allowed */
int maxtimeskew;
Expand Down Expand Up @@ -297,7 +297,7 @@ int read_config(const char *path, int type);

int check_config(int type);

int find_site_by_name(unsigned char *site, struct booth_site **node, int any_type);
int find_site_by_name(char *site, struct booth_site **node, int any_type);
int find_site_by_id(uint32_t site_id, struct booth_site **node);

const char *type_to_string(int type);
Expand Down
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ void list_peers(int fd)
*/
static void trim_key()
{
unsigned char *p;
char *p;
int i;

for (i=0, p=booth_conf->authkey; i < booth_conf->authkey_len; i++, p++)
Expand Down