extras/geo-rep/gsync-sync-gfid.c: move from strlen() to sizeof()
For const strings, just do compile-time size calc instead of runtime. Compile-tested only! Change-Id: I89470016389a4ecb3bed35a1c9e684f5fae79997 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
This commit is contained in:
parent
a2c562eb40
commit
7e229cf1d5
@ -30,7 +30,7 @@ main (int argc, char *argv[])
|
||||
char *gfid = NULL;
|
||||
char *bname = NULL;
|
||||
int ret = -1;
|
||||
int len = 0;
|
||||
int len = 0;
|
||||
FILE *fp = NULL;
|
||||
char line[GLFS_LINE_MAX] = {0,};
|
||||
char *path = NULL;
|
||||
@ -65,9 +65,10 @@ main (int argc, char *argv[])
|
||||
while(isspace (*path))
|
||||
path++;
|
||||
|
||||
if ((strlen (line) < GLFS_LINE_MAX) &&
|
||||
(line[strlen (line) - 1] == '\n'))
|
||||
line[strlen (line) - 1] = '\0';
|
||||
len = strlen (line);
|
||||
if ((len < GLFS_LINE_MAX) &&
|
||||
(line[len - 1] == '\n'))
|
||||
line[len - 1] = '\0';
|
||||
|
||||
line[UUID_CANONICAL_FORM_LEN] = '\0';
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user