aboutsummaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/Database/Field.cpp16
-rw-r--r--src/shared/Util.cpp2
2 files changed, 13 insertions, 5 deletions
diff --git a/src/shared/Database/Field.cpp b/src/shared/Database/Field.cpp
index 8a02ec716e3..191a2884aac 100644
--- a/src/shared/Database/Field.cpp
+++ b/src/shared/Database/Field.cpp
@@ -31,8 +31,12 @@ Field::Field(Field &f)
value = f.GetString();
- if (value && (mValue = new char[strlen(value) + 1]))
- strcpy(mValue, value);
+ if (value)
+ {
+ mValue = new char[strlen(value) + 1];
+ if (mValue)
+ strcpy(mValue, value);
+ }
else
mValue = NULL;
@@ -42,8 +46,12 @@ Field::Field(Field &f)
Field::Field(const char *value, enum Field::DataTypes type) :
mType(type)
{
- if (value && (mValue = new char[strlen(value) + 1]))
- strcpy(mValue, value);
+ if (value)
+ {
+ mValue = new char[strlen(value) + 1];
+ if (mValue)
+ strcpy(mValue, value);
+ }
else
mValue = NULL;
}
diff --git a/src/shared/Util.cpp b/src/shared/Util.cpp
index 3c5e365b749..a3c017fdbfd 100644
--- a/src/shared/Util.cpp
+++ b/src/shared/Util.cpp
@@ -425,7 +425,7 @@ void utf8printf(FILE *out, const char *str, ...)
{
va_list ap;
va_start(ap, str);
- vutf8printf(stdout, str, &ap);
+ vutf8printf(out, str, &ap);
va_end(ap);
}