strings that had the same length as the char array (in this case the zero
terminator must be omitted by the compiler).
git-svn-id: svn://svn.cc65.org/cc65/trunk@2230
b7a2c559-68d2-44c3-8de9-
860c34a00d81
/* Translate into target charset */
TranslateLiteralPool (CurTok.IVal);
+
+ /* If the array is one too small for the string literal, omit the
+ * trailing zero.
+ */
+ if (ElementCount != UNSPECIFIED &&
+ ElementCount != FLEXIBLE &&
+ Count == ElementCount + 1) {
+ /* Omit the trailing zero */
+ --Count;
+ }
+
+ /* Output the data */
g_defbytes (Str, Count);
/* Remove string from pool */