Skip to content

Commit

Permalink
rip out strlcpy
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmens committed Mar 23, 2018
1 parent 4d1d1d8 commit 9d57500
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 39 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ LOCAL_CONF = $(wildcard $(host-name).make)
BEANSTALK=no
#
CC=gcc -g
CFLAGS= -DMAXSPLITPARTS=500 -Idevices/ -I. -I/usr/local/include -Wall -Werror
CFLAGS= -DMAXSPLITPARTS=500 -Idevices/ -I. -I/usr/local/include -Wall -Werror
LDFLAGS=-L /usr/local/lib -lmosquitto -lm

OBJS= util.o \
Expand Down
3 changes: 1 addition & 2 deletions iinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/

#include <string.h>
#include "strlcpy.h"
#include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
Expand Down Expand Up @@ -57,7 +56,7 @@ struct _iinfo *lookup_iinfo(const char *directory, char *key)
char *name = slurp_file(path, true);

s = (struct _iinfo *)malloc(sizeof(struct _iinfo));
strlcpy(s->key, key, IINFOKEYSIZE);
strcpy(s->key, key);
s->name = (name) ? name : strdup(".");

HASH_ADD_STR(myhash, key, s);
Expand Down
3 changes: 1 addition & 2 deletions json.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "strlcpy.h"

#define out_of_memory() do { \
fprintf(stderr, "Out of memory.\n"); \
Expand All @@ -42,7 +41,7 @@ static char *json_strdup(const char *str)
char *ret = (char*) malloc(n);
if (ret == NULL)
out_of_memory();
strlcpy(ret, str, n);
strcpy(ret, str);
return ret;
}

Expand Down
24 changes: 0 additions & 24 deletions strlcpy.c

This file was deleted.

7 changes: 0 additions & 7 deletions strlcpy.h

This file was deleted.

5 changes: 2 additions & 3 deletions tline.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "strlcpy.h"
#include <unistd.h>
#include <math.h>
#include <mosquitto.h>
Expand Down Expand Up @@ -409,8 +408,8 @@ char *handle_report(struct udata *ud, char *line, char **response)
splitterfree(tparts);
goto finish;
}
strlcpy(abr, tparts[0], sizeof(abr));
strlcpy(subtype, tparts[1], sizeof(subtype));
strcpy(abr, tparts[0]);
strcpy(subtype, tparts[1]);
splitterfree(tparts);


Expand Down

0 comments on commit 9d57500

Please sign in to comment.