From 78d647da02c48dcdc4d93ee621f578aaa4d1c005 Mon Sep 17 00:00:00 2001 From: "henryk@ploetzli.ch" Date: Thu, 3 Dec 2009 16:21:44 +0000 Subject: [PATCH] Limit hexsamples to just the amount of requested samples --- winsrc/command.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/winsrc/command.cpp b/winsrc/command.cpp index 45683074..0214a0ab 100644 --- a/winsrc/command.cpp +++ b/winsrc/command.cpp @@ -909,9 +909,12 @@ static void CmdHexsamples(char *str) { int i; int n; + int requested = atoi(str); + int delivered = 0; if(atoi(str) == 0) { n = 12; + requested = 12; } else { n = atoi(str)/4; } @@ -939,7 +942,12 @@ static void CmdHexsamples(char *str) c.d.asBytes[j+7], c.d.asBytes[j+8] ); + delivered += 8; + if(delivered >= requested) + break; } + if(delivered >= requested) + break; } } -- 2.39.5