openbsd-ports/audio/sox/patches/patch-src_stretch_c
2006-10-18 15:41:06 +00:00

64 lines
2.7 KiB
Plaintext

$OpenBSD: patch-src_stretch_c,v 1.1 2006/10/18 15:41:06 naddy Exp $
--- src/stretch.c.orig Wed Oct 18 16:38:57 2006
+++ src/stretch.c Wed Oct 18 16:39:57 2006
@@ -115,14 +115,14 @@ int st_stretch_getopts(eff_t effp, int n
if (n>0 && !sscanf(argv[0], STRETCH_FLOAT_SCAN, &stretch->factor))
{
- sprintf (usage, "%s\n\terror while parsing factor", st_stretch_effect.usage);
+ snprintf (usage, sizeof(usage), "%s\n\terror while parsing factor", st_stretch_effect.usage);
st_fail(usage);
return ST_EOF;
}
if (n>1 && !sscanf(argv[1], STRETCH_FLOAT_SCAN, &stretch->window))
{
- sprintf (usage, "%s\n\terror while parsing window size", st_stretch_effect.usage);
+ snprintf (usage, sizeof(usage), "%s\n\terror while parsing window size", st_stretch_effect.usage);
st_fail(usage);
return ST_EOF;
}
@@ -136,7 +136,7 @@ int st_stretch_getopts(eff_t effp, int n
stretch->fade = st_linear_fading;
break;
default:
- sprintf (usage, "%s\n\terror while parsing fade type", st_stretch_effect.usage);
+ snprintf (usage, sizeof(usage), "%s\n\terror while parsing fade type", st_stretch_effect.usage);
st_fail(usage);
return ST_EOF;
}
@@ -148,14 +148,14 @@ int st_stretch_getopts(eff_t effp, int n
if (n>3 && !sscanf(argv[3], STRETCH_FLOAT_SCAN, &stretch->shift))
{
- sprintf (usage, "%s\n\terror while parsing shift ratio", st_stretch_effect.usage);
+ snprintf (usage, sizeof(usage), "%s\n\terror while parsing shift ratio", st_stretch_effect.usage);
st_fail(usage);
return ST_EOF;
}
if (stretch->shift > ONE || stretch->shift <= ZERO)
{
- sprintf (usage, "%s\n\terror with shift ratio value", st_stretch_effect.usage);
+ snprintf (usage, sizeof(usage), "%s\n\terror with shift ratio value", st_stretch_effect.usage);
st_fail(usage);
return ST_EOF;
}
@@ -171,14 +171,14 @@ int st_stretch_getopts(eff_t effp, int n
if (n>4 && !sscanf(argv[4], STRETCH_FLOAT_SCAN, &stretch->fading))
{
- sprintf (usage, "%s\n\terror while parsing fading ratio", st_stretch_effect.usage);
+ snprintf (usage, sizeof(usage), "%s\n\terror while parsing fading ratio", st_stretch_effect.usage);
st_fail(usage);
return ST_EOF;
}
if (stretch->fading > HALF || stretch->fading < ZERO)
{
- sprintf (usage, "%s\n\terror with fading ratio value", st_stretch_effect.usage);
+ snprintf (usage, sizeof(usage), "%s\n\terror with fading ratio value", st_stretch_effect.usage);
st_fail(usage);
return ST_EOF;
}