There is no need to use a buffer at all.
[oweals/opkg-lede.git] / libopkg / opkg.c
index aea87fc4f5488768deab8a811c28ce59a6743cd6..437beb1b8890117ee6c01602ada33f4efbe86b6b 100644 (file)
@@ -766,10 +766,8 @@ opkg_update_package_lists (opkg_t *opkg, opkg_progress_callback_t progress_callb
     }
   }
 
-  tmp = xstrdup("/tmp/opkg.XXXXXX");
-
-  if (mkdtemp (tmp) == NULL)
-  {
+  sprintf_alloc(&tmp, "%s/update-XXXXXX", opkg->conf->tmp_dir);
+  if (mkdtemp (tmp) == NULL) {
     /* XXX: Error: could not create temporary file name */
     free (lists_dir);
     free (tmp);