Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions subsync.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ static time_t strtoms(char *s, int *len, int *style);
static char *mstostr(time_t ms, int style);
static double arg_scale(char *s);
static time_t arg_offset(char *s);
static int isnumber(char *s);
static int is_number(char *s);
static int help_tools(int argc, char **argv);
static void test_str_to_ms(void);

Expand All @@ -134,7 +134,7 @@ int main(int argc, char **argv)

while (--argc && ((**++argv == '-') || (**argv == '+'))) {
if (!strcmp(*argv, "-V") || !strcmp(*argv, "--version")) {
printf(subsync_version);
printf("%s", subsync_version);
return 0;
} else if (!strcmp(*argv, "-H") || !strcmp(*argv, "--help")) {
puts(subsync_help);
Expand All @@ -151,7 +151,7 @@ int main(int argc, char **argv)
tm_chop[0] = tm_chop[1] = -1;
}
} else if (!strcmp(*argv, "-r") || !strcmp(*argv, "--reorder")) {
if ((argc > 0) && isnumber(argv[1])) {
if ((argc > 0) && is_number(argv[1])) {
--argc; tm_srtsn = (int)strtol(*++argv, NULL, 0);
} else {
tm_srtsn = 1; /* set as default */
Expand Down Expand Up @@ -320,7 +320,7 @@ static int retiming(FILE *fin, FILE *fout)
s += n;
/* output the tweaked timestamp */
fputs(mstostr(tweaktime(ms), style), fout);
} else if ((srtsn > 0) && isnumber(s)) {
} else if ((srtsn > 0) && is_number(s)) {
/* SRT serial numbers to be re-ordered */
fprintf(fout, "%d", srtsn++);
while (isdigit(*s)) s++;
Expand Down Expand Up @@ -360,7 +360,7 @@ static int chop_filter(char *s, int *magic)

switch (*magic) {
case 0: /* subrip */
if (isnumber(s)) {
if (is_number(s)) {
subidx++;
}
//printf("SRT %d\n", subidx);
Expand Down Expand Up @@ -388,7 +388,7 @@ static int chop_filter(char *s, int *magic)
if (*magic > 0) {
break; /* something wrong */
}
if (isnumber(s)) {
if (is_number(s)) {
*magic = 0;
subidx++;
} else if (strtoms(s, NULL, NULL) != -1) { /* SRT timestamp */
Expand Down Expand Up @@ -603,7 +603,7 @@ static time_t arg_offset(char *s)
return -1;
}

static int isnumber(char *s)
static int is_number(char *s)
{
if (!isdigit(*s)) {
return 0;
Expand Down