summaryrefslogtreecommitdiff
path: root/app/bin/param.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2018-05-05 18:22:19 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2018-05-05 18:22:19 +0200
commit498011c44291d7d619143ce5ff3e38369d759c22 (patch)
tree5b4d1fdd686089c0c1778a462e27fa694b8f49be /app/bin/param.c
parent67d0ce65dc6a1d240e271a7cd479b60aa1dc2967 (diff)
parent9a1d6eded2750572e9f5f79e53ec507dd7a06ba5 (diff)
Update upstream source from tag 'upstream/5.1.1'
Update to upstream version '5.1.1' with Debian dir 878f8cb06af8c1037570ac8774f9261ff9b12fa4
Diffstat (limited to 'app/bin/param.c')
-rw-r--r--app/bin/param.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/app/bin/param.c b/app/bin/param.c
index e513bc3..47399ee 100644
--- a/app/bin/param.c
+++ b/app/bin/param.c
@@ -589,9 +589,9 @@ EXPORT void ParamLoadControl(
if (p->oldD.s)
MyFree( p->oldD.s );
if (p->context) {
- p->oldD.s = MyMalloc((intptr_t)p->context);
- strncpy(p->oldD.s, (char*)p->valueP, (intptr_t)p->context);
- *(p->oldD.s + (intptr_t)p->context - 1) = '\0';
+ p->oldD.s = MyMalloc((uint32_t)p->context);
+ strncpy(p->oldD.s, (char*)p->valueP, (uint32_t)p->context);
+ *(p->oldD.s + (uint32_t)p->context - 1) = '\0';
wStringSetValue((wString_p)p->control, (char*)p->oldD.s);
}
else {
@@ -730,12 +730,12 @@ EXPORT long ParamUpdate(
if (p->oldD.s)
MyFree( p->oldD.s );
p->oldD.s = MyStrdup( stringV );
- if ( /*(p->option&PDO_NOUPDUPD)==0 &&*/ p->valueP) {
- if (p->context) {
- strncpy((char*)p->valueP, stringV, (intptr_t)p->context);
- ((char *)p->valueP)[(intptr_t)p->context - 1] = '\0';
- if (strlen(stringV) > (uintptr_t)p->context) {
- NoticeMessage2(0, MSG_ENTERED_STRING_TRUNCATED, _("Ok"), NULL, (intptr_t)p->context);
+ if ( p->valueP ) {
+ if (p->option & PDO_STRINGLIMITLENGTH ) {
+ strncpy((char*)p->valueP, stringV, (uint32_t)p->context);
+ ((char *)p->valueP)[(uint32_t)p->context - 1] = '\0';
+ if (strlen(stringV) > (uint32_t)p->context) {
+ NoticeMessage2(0, MSG_ENTERED_STRING_TRUNCATED, _("Ok"), NULL, (uint32_t)p->context);
}
}