Removed buggy burn_strdup() and burn_strndup(). Thanks to Rich Felker.

1.2.6
Thomas Schmitt 10 years ago
parent 4cfa8170ee
commit eb86e5298a
  1. 2
      cdrskin/cdrskin_timestamp.h
  2. 2
      libburn/drive.c
  3. 2
      libburn/sg-freebsd.c
  4. 36
      libburn/util.c
  5. 4
      libburn/util.h

@ -1 +1 @@
#define Cdrskin_timestamP "2012.07.26.122909"
#define Cdrskin_timestamP "2012.08.28.161949"

@ -69,7 +69,7 @@ extern int burn_drive_role_4_allowed;
*/
int burn_setup_drive(struct burn_drive *d, char *fname)
{
d->devname = burn_strdup(fname);
d->devname = strdup(fname);
memset(&d->params, 0, sizeof(struct params));
d->idata = NULL;
d->mdata = NULL;

@ -448,7 +448,7 @@ static void enumerate_common(char *fname, int bus_no, int host_no,
out.channel = channel_no;
out.lun = lun_no;
out.devname = burn_strdup(fname);
out.devname = strdup(fname);
out.cam = NULL;
out.lock_fd = -1;

@ -23,42 +23,6 @@
#include "util.h"
#include "libburn.h"
char *burn_strdup(char *s)
{
char *ret;
int l;
/* ts A61008 */
/* a ssert(s); */
if (s == NULL)
return NULL;
l = strlen(s) + 1;
ret = calloc(1, l);
memcpy(ret, s, l);
return ret;
}
char *burn_strndup(char *s, int n)
{
char *ret;
int l;
/* ts A61008 */
/* a ssert(s); */
/* a ssert(n > 0); */
if (s == NULL || n <= 0)
return NULL;
l = strlen(s);
ret = calloc(1, l < n ? l : n);
memcpy(ret, s, l < n - 1 ? l : n - 1);
ret[n - 1] = '\0';
return ret;
}
void burn_version(int *major, int *minor, int *micro)
{

@ -1,10 +1,6 @@
#ifndef __UTIL
#define __UTIL
char *burn_strdup(char *s);
char *burn_strndup(char *s, int n);
/* ts A90905 */
int burn_util_make_printable_word(char **text, int flag);

Loading…
Cancel
Save