New command -extract_boot_images
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
|
||||
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
|
||||
|
||||
Copyright 2007-2014 Thomas Schmitt, <scdbackup@gmx.net>
|
||||
Copyright 2007-2020 Thomas Schmitt, <scdbackup@gmx.net>
|
||||
|
||||
Provided under GPL version 2 or later.
|
||||
|
||||
@ -430,6 +430,32 @@ int Sfile_off_t_text(char text[80], off_t num, int flag)
|
||||
}
|
||||
|
||||
|
||||
/* @return index number of first not interpreted text byte
|
||||
*/
|
||||
int Sfile_text_to_off_t(char *text, off_t *num, int flag)
|
||||
{
|
||||
int sig= 1, ridx;
|
||||
|
||||
*num= 0;
|
||||
ridx= 0;
|
||||
if(text[ridx] == '-') {
|
||||
sig= -1;
|
||||
ridx++;
|
||||
} else if(text[ridx] == '+') {
|
||||
ridx++;
|
||||
}
|
||||
for(; text[ridx] != 0; ridx++) {
|
||||
if(text[ridx] < '0' || text[ridx] > '9')
|
||||
break;
|
||||
if(*num > (((off_t) 1) << 59))
|
||||
return(-1);
|
||||
*num= *num * 10 + text[ridx] - '0';
|
||||
}
|
||||
*num= *num * sig;
|
||||
return(ridx);
|
||||
}
|
||||
|
||||
|
||||
/* Converts backslash codes into single characters:
|
||||
\a BEL 7 , \b BS 8 , \e ESC 27 , \f FF 12 , \n LF 10 , \r CR 13 ,
|
||||
\t HT 9 , \v VT 11 , \\ \ 92
|
||||
|
Reference in New Issue
Block a user