Fix bugs in ArrayType::GetString() and GetCDeclaration()
This commit is contained in:
4
type.cpp
4
type.cpp
@@ -1012,7 +1012,7 @@ ArrayType::GetString() const {
|
|||||||
// dimensions
|
// dimensions
|
||||||
while (at) {
|
while (at) {
|
||||||
char buf[16];
|
char buf[16];
|
||||||
if (numElements > 0)
|
if (at->numElements > 0)
|
||||||
sprintf(buf, "%d", at->numElements);
|
sprintf(buf, "%d", at->numElements);
|
||||||
else
|
else
|
||||||
buf[0] = '\0';
|
buf[0] = '\0';
|
||||||
@@ -1044,7 +1044,7 @@ ArrayType::GetCDeclaration(const std::string &name) const {
|
|||||||
const ArrayType *at = this;
|
const ArrayType *at = this;
|
||||||
while (at) {
|
while (at) {
|
||||||
char buf[16];
|
char buf[16];
|
||||||
if (numElements > 0)
|
if (at->numElements > 0)
|
||||||
sprintf(buf, "%d", at->numElements);
|
sprintf(buf, "%d", at->numElements);
|
||||||
else
|
else
|
||||||
buf[0] = '\0';
|
buf[0] = '\0';
|
||||||
|
|||||||
Reference in New Issue
Block a user