Skip to content

Commit

Permalink
Fix types to avoid signedness errors in friend.c
Browse files Browse the repository at this point in the history
  • Loading branch information
albel727 committed Sep 25, 2014
1 parent 9130f26 commit da05fd0
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions friend.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,18 @@ void friend_add(char_t *name, uint16_t length, char_t *msg, uint16_t msg_length)

void friend_free(FRIEND *f)
{
int i = 0;
while(i != f->edit_history_length) {
free(f->edit_history[i]);
i++;
uint16_t j = 0;
while(j != f->edit_history_length) {
free(f->edit_history[j]);
j++;
}
free(f->edit_history);

free(f->name);
free(f->status_message);
free(f->typed);

i = 0;
MSG_IDX i = 0;
while(i < f->msg.n) {
MESSAGE *msg = f->msg.data[i];
if((msg->flags & (~1)) == 4) {
Expand Down Expand Up @@ -193,27 +193,27 @@ void friend_free(FRIEND *f)

void group_free(GROUPCHAT *g)
{
int i = 0;
uint16_t i = 0;
while(i != g->edit_history_length) {
free(g->edit_history[i]);
i++;
}
free(g->edit_history);

uint8_t **np = g->peername;
i = 0;
while(i < g->peers) {
uint32_t j = 0;
while(j < g->peers) {
uint8_t *n = *np++;
if(n) {
free(n);
i++;
j++;
}
}

i = 0;
while(i < g->msg.n) {
free(g->msg.data[i]);
i++;
MSG_IDX k = 0;
while(k < g->msg.n) {
free(g->msg.data[k]);
k++;
}

free(g->msg.data);
Expand Down

0 comments on commit da05fd0

Please sign in to comment.