Skip to content

Commit aea16e4

Browse files
committed
Update to GCC 14.1.0
1 parent aca3f78 commit aea16e4

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

src/m3u8errors.c

+2
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ const char* m3u8err_getmessage(const int code) {
8181
return "The arguments -o/--output and -S/--list-streams cannot be used together";
8282
case M3U8ERR_CLI_ARGUMENT_INVALID:
8383
return "This argument is invalid or was not recognized";
84+
case M3U8ERR_CLI_NO_STREAMS_SELECTED:
85+
return "No streams selected";
8486
case M3U8ERR_FFMPEG_MUXING_FAILURE:
8587
return "Could not mux media streams";
8688
case M3U8ERR_CURLU_INIT_FAILURE:

src/m3u8errors.h

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#define M3U8ERR_CLI_OUTPUT_MISSING_FILE_EXTENSION -36 /* The output filename does not contain a file extension */
4343
#define M3U8ERR_CLI_OUTPUT_AND_LIST_STREAMS_USED_TOGETHER -200 /* The arguments -o/--output and -S/--list-streams cannot be used together */
4444
#define M3U8ERR_CLI_ARGUMENT_INVALID -9000 /* This argument is invalid or was not recognized */
45+
#define M3U8ERR_CLI_NO_STREAMS_SELECTED -9001 /* No streams selected */
4546

4647
#define M3U8ERR_FFMPEG_MUXING_FAILURE -37 /* Could not mux media streams */
4748

src/main.c

+9-4
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,8 @@ int main(int argc, argv_t* argv[]) {
702702
free(output);
703703
output = name;
704704

705+
name = NULL;
706+
705707
file_extension = get_file_extension(output);
706708

707709
if (file_extension == NULL) {
@@ -915,6 +917,11 @@ int main(int argc, argv_t* argv[]) {
915917
}
916918
}
917919

920+
if (selected_streams.offset == 0) {
921+
err = M3U8ERR_CLI_NO_STREAMS_SELECTED;
922+
goto end;
923+
}
924+
918925
for (index = 0; index < selected_streams.offset; index++) {
919926
const struct M3U8StreamItem* item = NULL;
920927

@@ -1041,13 +1048,11 @@ int main(int argc, argv_t* argv[]) {
10411048
break;
10421049
}
10431050
case M3U8ERR_CLI_ARGUMENT_VALUE_MISSING:
1044-
case M3U8ERR_CLI_DUPLICATE_ARGUMENT: {
1051+
case M3U8ERR_CLI_DUPLICATE_ARGUMENT:
1052+
case M3U8ERR_CLI_ARGUMENT_INVALID: {
10451053
fprintf(stderr, ": %.*s%s", 1 + (strlen(argument->key) > 1), "--", argument->key);
10461054
break;
10471055
}
1048-
case M3U8ERR_CLI_ARGUMENT_INVALID:
1049-
fprintf(stderr, ": %s", argument->key);
1050-
break;
10511056
case M3U8ERR_PARSER_INVALID_UINT: {
10521057
fprintf(stderr, ": %s", argument->value);
10531058
break;

src/os.c

+2-6
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static const char* strip_trailing_separator(char* const s) {
5050
const char* const start = s;
5151
char* end = strchr(s, '\0');
5252

53-
const char separator = '/';
53+
const char separator = PATHSEP[0];
5454

5555
if (start == end) {
5656
return s;
@@ -348,11 +348,7 @@ char* get_temporary_directory(void) {
348348
}
349349
#endif
350350

351-
ptr = strchr(temporary_directory, '\0');
352-
353-
if (ptr != NULL && *(ptr - 1) == *PATHSEP) {
354-
*(ptr - 1) = '\0';
355-
}
351+
strip_trailing_separator(temporary_directory);
356352
#else
357353
size_t index = 0;
358354

0 commit comments

Comments
 (0)