1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-09-29 04:25:55 -04:00

I Hate String Handling In C.

svn path=/trunk/icecast/; revision=5818
This commit is contained in:
Michael Smith 2004-02-10 04:37:30 +00:00
parent 3d9d45c488
commit 350c524cc8

View File

@ -334,10 +334,15 @@ static int format_mp3_get_buffer(format_plugin_t *self, char *data,
int stringlength;
state->metadata = malloc(state->metadata_length -
15 + 1);
12);
memcpy(state->metadata,
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);
if(stringlength > 2)
state->metadata[stringlength - 2] = 0;