summaryrefslogtreecommitdiff
path: root/audio/vorbis-tools/patches/patch-ac
blob: e26e2d04a6e73b1ef75fdabe7865cc8a088e4df6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
$NetBSD: patch-ac,v 1.6 2003/12/08 14:43:48 wiz Exp $

--- oggenc/oggenc.c.orig	Tue Sep 16 00:04:00 2003
+++ oggenc/oggenc.c
@@ -640,6 +640,8 @@ static void parse_options(int argc, char
 
 				break;
 			case 'a':
+				if (strlen(optarg) == 0)
+					break;
 				opt->artist = realloc(opt->artist, (++opt->artist_count)*sizeof(char *));
 				opt->artist[opt->artist_count - 1] = strdup(optarg);
 				break;
@@ -652,10 +654,14 @@ static void parse_options(int argc, char
 				opt->comments[opt->comment_count - 1] = strdup(optarg);
 				break;
 			case 'd':
+				if (strlen(optarg) == 0)
+					break;
 				opt->dates = realloc(opt->dates, (++opt->date_count)*sizeof(char *));
 				opt->dates[opt->date_count - 1] = strdup(optarg);
 				break;
             case 'G':
+				if (strlen(optarg) == 0)
+					break;
                 opt->genre = realloc(opt->genre, (++opt->genre_count)*sizeof(char *));
                 opt->genre[opt->genre_count - 1] = strdup(optarg);
                 break;
@@ -664,6 +670,8 @@ static void parse_options(int argc, char
 				exit(0);
 				break;
 			case 'l':
+				if (strlen(optarg) == 0)
+					break;
 				opt->album = realloc(opt->album, (++opt->album_count)*sizeof(char *));
 				opt->album[opt->album_count - 1] = strdup(optarg);
 				break;
@@ -674,6 +682,8 @@ static void parse_options(int argc, char
 					opt->serial = 0; /* Failed, so just set to zero */
 				break;
 			case 't':
+				if (strlen(optarg) == 0)
+					break;
 				opt->title = realloc(opt->title, (++opt->title_count)*sizeof(char *));
 				opt->title[opt->title_count - 1] = strdup(optarg);
 				break;