Reacted on warning of cppcheck about libburn/sg-dummy.c

This commit is contained in:
Thomas Schmitt 2011-07-12 14:19:12 +00:00
parent 0894f7773e
commit 7620840490
2 changed files with 5 additions and 4 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2011.07.12.141659" #define Cdrskin_timestamP "2011.07.12.141838"

View File

@ -1,7 +1,7 @@
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
/* /*
Copyright (c) 2009 - 2010 Thomas Schmitt <scdbackup@gmx.net> Copyright (c) 2009 - 2011 Thomas Schmitt <scdbackup@gmx.net>
Provided under GPL version 2 or later. Provided under GPL version 2 or later.
*/ */
@ -253,14 +253,12 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
#endif #endif
char *testpath = NULL, *cpt; char *testpath = NULL, *cpt;
long blocks;
off_t add_size = 0; off_t add_size = 0;
int ret; int ret;
BURN_ALLOC_MEM(testpath, char, 4096); BURN_ALLOC_MEM(testpath, char, 4096);
testpath[0] = 0; testpath[0] = 0;
blocks = *bytes / 512;
if (stat(path, &stbuf) == -1) { if (stat(path, &stbuf) == -1) {
strcpy(testpath, path); strcpy(testpath, path);
cpt = strrchr(testpath, '/'); cpt = strrchr(testpath, '/');
@ -276,6 +274,9 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
#ifdef Libburn_if_this_was_linuX #ifdef Libburn_if_this_was_linuX
} else if(S_ISBLK(stbuf.st_mode)) { } else if(S_ISBLK(stbuf.st_mode)) {
long blocks;
blocks = *bytes / 512;
fd = open(path, open_mode); fd = open(path, open_mode);
if (fd == -1) if (fd == -1)
{ret = -2; goto ex;} {ret = -2; goto ex;}