summaryrefslogtreecommitdiffstats
path: root/src/base/cmd/cmdHist.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2017-07-01 13:48:31 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2017-07-01 13:48:31 -0700
commitbf6a053c648576c1e5493f2d5390eb78b2e3df1c (patch)
tree19c0e561e0d56178c40bb1030ccd738fa5455501 /src/base/cmd/cmdHist.c
parenta1dd7e3fb04660e025f8cb37eb2636d3d700c3ac (diff)
downloadabc-bf6a053c648576c1e5493f2d5390eb78b2e3df1c.tar.gz
abc-bf6a053c648576c1e5493f2d5390eb78b2e3df1c.tar.bz2
abc-bf6a053c648576c1e5493f2d5390eb78b2e3df1c.zip
Saturating floating point computation.
Diffstat (limited to 'src/base/cmd/cmdHist.c')
-rw-r--r--src/base/cmd/cmdHist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/base/cmd/cmdHist.c b/src/base/cmd/cmdHist.c
index 36e546a7..218d832f 100644
--- a/src/base/cmd/cmdHist.c
+++ b/src/base/cmd/cmdHist.c
@@ -57,7 +57,7 @@ void Cmd_HistoryAddCommand( Abc_Frame_t * p, const char * command )
return;
Len = strlen(command);
strcpy( Buffer, command );
- if ( Buffer[Len-1] == '\n' )
+ if ( Len > 0 && Buffer[Len-1] == '\n' )
Buffer[Len-1] = 0;
if ( strlen(Buffer) > 3 &&
strncmp(Buffer,"set",3) &&