Commit 350c524c authored by Michael Smith's avatar Michael Smith

I Hate String Handling In C.

svn path=/trunk/icecast/; revision=5818
parent 3d9d45c4
...@@ -334,10 +334,15 @@ static int format_mp3_get_buffer(format_plugin_t *self, char *data, ...@@ -334,10 +334,15 @@ static int format_mp3_get_buffer(format_plugin_t *self, char *data,
int stringlength; int stringlength;
state->metadata = malloc(state->metadata_length - state->metadata = malloc(state->metadata_length -
15 + 1); 12);
memcpy(state->metadata, memcpy(state->metadata,
state->metadata_buffer + 13, state->metadata_buffer + 13,
state->metadata_length - 15); state->metadata_length - 13);
/* Make sure we've got a null-terminator of some
sort */
state->metadata[state->metadata_length - 13] = 0;
/* Now figure out the _right_ one */
stringlength = strlen(state->metadata); stringlength = strlen(state->metadata);
if(stringlength > 2) if(stringlength > 2)
state->metadata[stringlength - 2] = 0; state->metadata[stringlength - 2] = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment