Limit hexsamples to just the amount of requested samples

This commit is contained in:
henryk@ploetzli.ch 2009-12-03 16:21:44 +00:00
parent 68d9d60a4d
commit 78d647da02

View file

@ -909,9 +909,12 @@ static void CmdHexsamples(char *str)
{ {
int i; int i;
int n; int n;
int requested = atoi(str);
int delivered = 0;
if(atoi(str) == 0) { if(atoi(str) == 0) {
n = 12; n = 12;
requested = 12;
} else { } else {
n = atoi(str)/4; n = atoi(str)/4;
} }
@ -939,7 +942,12 @@ static void CmdHexsamples(char *str)
c.d.asBytes[j+7], c.d.asBytes[j+7],
c.d.asBytes[j+8] c.d.asBytes[j+8]
); );
delivered += 8;
if(delivered >= requested)
break;
} }
if(delivered >= requested)
break;
} }
} }