summaryrefslogtreecommitdiffstats
path: root/libidu/idfile.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-01-04 16:04:11 +0100
committerJim Meyering <meyering@redhat.com>2008-01-30 21:33:58 +0100
commit3cda817f6cd73abfed5bdcc567735ad633904d41 (patch)
tree8105c2883935e5fcfa3213d7f35ab22f4c5f7935 /libidu/idfile.c
parent3fafc39a27e3989eeabaec610942bd9f81d2a6b0 (diff)
downloadidutils-3cda817f6cd73abfed5bdcc567735ad633904d41.tar.gz
idutils-3cda817f6cd73abfed5bdcc567735ad633904d41.tar.bz2
idutils-3cda817f6cd73abfed5bdcc567735ad633904d41.zip
Use xstrdup, not strdup.
* src/lid.c (get_editor_argv): Use xstrdup, not strdup. * libidu/walker.c (get_current_dir_link): Likewise. * libidu/idfile.c: Include "xalloc.h". (locate_id_file_name): Handle failed strdup. * libidu/scanners.c (parse_args_text, parse_args_perl): Likewise. (parse_args_c, parse_args_asm): Likewise.
Diffstat (limited to 'libidu/idfile.c')
-rw-r--r--libidu/idfile.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libidu/idfile.c b/libidu/idfile.c
index 5ba9f11..20b9d55 100644
--- a/libidu/idfile.c
+++ b/libidu/idfile.c
@@ -22,12 +22,13 @@
#include <errno.h>
#include <stdlib.h>
#include <string.h>
-#include "lstat.h"
#include <obstack.h>
#include <error.h>
-#include "xnls.h"
#include "idfile.h"
+#include "lstat.h"
+#include "xalloc.h"
+#include "xnls.h"
int io_size (FILE *, void *, unsigned int size, int);
@@ -53,7 +54,7 @@ locate_id_file_name (char const *arg)
id_path = getenv ("IDPATH");
if (id_path)
{
- id_path = strdup (id_path);
+ id_path = xstrdup (id_path);
arg = strsep (&id_path, ":");
/* FIXME: handle multiple ID file names */
}