Skip to content

Commit

Permalink
Fixed some warnings from code analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
winterheart committed Apr 2, 2019
1 parent 84509f7 commit 834bfa3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/dirutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ char *dirnamex(char *pathname) {
* stripslash("/") returns "/";
*/
char *stripslash(char *pathname) {
int len = strlen(pathname);
size_t len = strlen(pathname);
while (len > 1 && pathname[len - 1] == '/')
pathname[--len] = '\0';
return pathname;
Expand Down
4 changes: 2 additions & 2 deletions src/pptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int call_ID;
//static struct in_addr get_ip_address(char *name);
static int open_callmgr(int call_id, struct in_addr inetaddr, char *phonenr, int window);

static void launch_callmgr(int call_is, struct in_addr inetaddr, char *phonenr, int window);
static void launch_callmgr(int call_id, struct in_addr inetaddr, char *phonenr, int window);

static int get_call_id(int sock, pid_t gre, pid_t pppd, u_int16_t *peer_call_id);

Expand Down Expand Up @@ -278,7 +278,7 @@ static int get_call_id(int sock, pid_t gre, pid_t pppd,
/* don't bother with network byte order, because pid's are meaningless
* outside the local host.
*/
int rc;
ssize_t rc;
rc = write(sock, &gre, sizeof(gre));
if (rc != sizeof(gre))
return -1;
Expand Down
2 changes: 1 addition & 1 deletion src/vector.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ int vector_insert(VECTOR *v, int key, PPTP_CALL *call) {
#ifdef VECTOR_DEBUG
assert(v->key_max < key);
#endif
if (!(v->size < v->alloc)) {
if (v->size >= v->alloc) {
void *tmp = realloc(v->item, sizeof(*(v->item)) * 2 * v->alloc);
if (tmp != NULL) {
v->alloc *= 2;
Expand Down

0 comments on commit 834bfa3

Please sign in to comment.