Use option m in fscanf
This commit is contained in:
parent
ae38c9eca6
commit
9e88f6b97b
@ -1,6 +1,10 @@
|
|||||||
ChangeLog for davfs2
|
ChangeLog for davfs2
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
|
2019-12-11 Werner Baumann (werner.baumann@onlinehome.de)
|
||||||
|
* umount_davfs.c
|
||||||
|
Use option 'm' in fscanf.
|
||||||
|
|
||||||
2019-01-17 Werner Baumann (werner.baumann@onlinehome.de)
|
2019-01-17 Werner Baumann (werner.baumann@onlinehome.de)
|
||||||
* cache.c, xml_end_reg:
|
* cache.c, xml_end_reg:
|
||||||
Don't remove cache-files because of inconsistent
|
Don't remove cache-files because of inconsistent
|
||||||
|
@ -152,9 +152,9 @@ main(int argc, char *argv[])
|
|||||||
char *pidfile = xasprintf("%s/%s.pid", DAV_SYS_RUN, mp);
|
char *pidfile = xasprintf("%s/%s.pid", DAV_SYS_RUN, mp);
|
||||||
free(mp);
|
free(mp);
|
||||||
|
|
||||||
char pid[32];
|
char *pid = NULL;
|
||||||
FILE *file = fopen(pidfile, "r");
|
FILE *file = fopen(pidfile, "r");
|
||||||
if (!file || fscanf(file, "%30[0-9]", pid) < 1) {
|
if (!file || fscanf(file, "%m[0-9]", &pid) != 1 || !pid) {
|
||||||
error(0, 0,
|
error(0, 0,
|
||||||
_("\n"
|
_("\n"
|
||||||
" can't read PID from file %s;\n"
|
" can't read PID from file %s;\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user