mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 16:44:49 +01:00
fix memcpy overwrite
git-svn-id: svn://136.177.114.72/svn_GW/phreeqc3/trunk@11412 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
8502196319
commit
baf36d4af5
14
model.cpp
14
model.cpp
@ -1679,19 +1679,19 @@ ineq(int in_kode)
|
||||
}
|
||||
#define SHRINK_ARRAY
|
||||
#ifdef SHRINK_ARRAY
|
||||
if ((sit_model /* || pitzer_model*/) && full_pitzer == FALSE)
|
||||
if ((sit_model || pitzer_model) && full_pitzer == FALSE)
|
||||
{
|
||||
n = count_unknowns - (int) s_list.size();
|
||||
for (int i = 0; i < l_count_rows; i++)
|
||||
{
|
||||
//for (int j = 0; j < n; j++)
|
||||
//{
|
||||
// ineq_array[i*(n+2) + j] = ineq_array[i*(count_unknowns+2) +j];
|
||||
//}
|
||||
if (i > 0)
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
memcpy((void *) &ineq_array[i*(n+2)], (void *) &ineq_array[i*(count_unknowns+2)], (size_t) (n) * sizeof(LDBLE));
|
||||
ineq_array[i*(n+2) + j] = ineq_array[i*(count_unknowns+2) +j];
|
||||
}
|
||||
//if (i > 0)
|
||||
//{
|
||||
// memcpy((void *) &ineq_array[i*(n+2)], (void *) &ineq_array[i*(count_unknowns+2)], (size_t) (n) * sizeof(LDBLE));
|
||||
//}
|
||||
ineq_array[i*(n+2) + n] = ineq_array[i*(count_unknowns+2) + count_unknowns];
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user