Skip to content

Commit

Permalink
#75
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Dec 3, 2020
1 parent dcb0397 commit eedd15b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/eez/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ const char *Module::getDefaultLabel() {

void Module::setLabel(const char *value, int length) {
if (length == -1) {
length = strlen(label);
length = strlen(value);
}
if (length > (int)SLOT_LABEL_MAX_LENGTH) {
length = SLOT_LABEL_MAX_LENGTH;
Expand Down
2 changes: 1 addition & 1 deletion src/eez/index.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ struct StepValues {
} encoderSettings;
};

static const size_t SLOT_LABEL_MAX_LENGTH = 8;
static const size_t SLOT_LABEL_MAX_LENGTH = 10;

typedef int eez_err_t;

Expand Down
2 changes: 1 addition & 1 deletion src/eez/modules/psu/channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1645,7 +1645,7 @@ const char *Channel::getLabel() {

const char *Channel::getDefaultLabel() {
static char g_defaultLabel[Channel::CHANNEL_LABEL_MAX_LENGTH + 1];
snprintf(g_defaultLabel, Channel::CHANNEL_LABEL_MAX_LENGTH, "%s #%d", g_slots[slotIndex]->moduleName, (int)(channelIndex + 1));
snprintf(g_defaultLabel, Channel::CHANNEL_LABEL_MAX_LENGTH + 1, "%s #%d", g_slots[slotIndex]->moduleName, (int)(channelIndex + 1));
g_defaultLabel[Channel::CHANNEL_LABEL_MAX_LENGTH] = 0;
return g_defaultLabel;
}
Expand Down
2 changes: 1 addition & 1 deletion src/eez/modules/psu/channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ struct Channel {

float outputDelayDuration;

static const size_t CHANNEL_LABEL_MAX_LENGTH = 8;
static const size_t CHANNEL_LABEL_MAX_LENGTH = 10;
char label[CHANNEL_LABEL_MAX_LENGTH + 1];
uint8_t color;

Expand Down

0 comments on commit eedd15b

Please sign in to comment.