projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
1d06ba6
)
libpspp/str.c (ds_splice_uninit): Add assertion
author
John Darrington
<john@darrington.wattle.id.au>
Sat, 20 Jun 2020 05:17:06 +0000
(07:17 +0200)
committer
John Darrington
<john@darrington.wattle.id.au>
Sat, 20 Jun 2020 05:18:19 +0000
(07:18 +0200)
src/libpspp/str.c
patch
|
blob
|
history
diff --git
a/src/libpspp/str.c
b/src/libpspp/str.c
index d855150b35f62530525d57e6d608adaa20df2f95..c227f7f6989da54c915b82884f6b6ee453a63ebf 100644
(file)
--- a/
src/libpspp/str.c
+++ b/
src/libpspp/str.c
@@
-1,5
+1,6
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2006, 2009, 2010, 2011, 2012, 2014 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2006, 2009, 2010, 2011, 2012, 2014,
+ 2020 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-1510,6
+1511,9
@@
ds_splice_uninit (struct string *st,
{
if (new_len > old_len)
ds_extend (st, ds_length (st) + (new_len - old_len));
{
if (new_len > old_len)
ds_extend (st, ds_length (st) + (new_len - old_len));
+
+ assert (ds_length (st) >= ofs + old_len);
+
memmove (ds_data (st) + (ofs + new_len),
ds_data (st) + (ofs + old_len),
ds_length (st) - (ofs + old_len));
memmove (ds_data (st) + (ofs + new_len),
ds_data (st) + (ofs + old_len),
ds_length (st) - (ofs + old_len));