summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Larson <slioch@slioch.vyatta.com>2010-05-20 14:11:24 -0700
committerMichael Larson <slioch@slioch.vyatta.com>2010-05-20 14:11:24 -0700
commit7fb9723429e0bed8690ba1cfa1b2af922496b96d (patch)
tree964e35760216401b205da91804982413b0839e9c
parenta80671d4a461e47d4c0248688af88aec5d2a572b (diff)
downloadvyatta-cfg-7fb9723429e0bed8690ba1cfa1b2af922496b96d.tar.gz
vyatta-cfg-7fb9723429e0bed8690ba1cfa1b2af922496b96d.zip
fixed error message on multinode limit exceeded--refer to parent node name, not value.
-rw-r--r--src/set.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/set.c b/src/set.c
index 180a8b0..08db114 100644
--- a/src/set.c
+++ b/src/set.c
@@ -137,13 +137,33 @@ boolean set_validate(vtw_def *defp, char *valp, boolean empty_val)
if (defp->tag) {
if (defp->def_tag > 0 && file_count >= defp->def_tag) {
- fprintf(out_stream,"Number of values exceeded for %s, allowed: %d, actual: %d\n",val,defp->def_tag,file_count);
+ char *p = rindex(path,'/');
+ char tmp[2048];
+ if (p != NULL) {
+ int off = p - path;
+ strncpy(tmp,path + off + 1, strlen(path) - off - 1);
+ tmp[strlen(path) - off - 1] = '\0';
+ fprintf(out_stream,"Number of values exceeded for '%s', allowed: %d, actual: %d\n",tmp,defp->def_tag,file_count);
+ }
+ else {
+ fprintf(out_stream,"Number of values exceeded, allowed: %d, actual: %d\n",defp->def_tag,file_count);
+ }
return FALSE;
}
}
else {
if (defp->def_multi > 1 && file_count >= defp->def_multi) {
- fprintf(out_stream,"Number of values exceeded for %s, allowed: %d, actual: %d\n",val,defp->def_multi,file_count);
+ char *p = rindex(path,'/');
+ char tmp[2048];
+ if (p != NULL) {
+ int off = p - path;
+ strncpy(tmp,path + off + 1, strlen(path) - off - 1);
+ tmp[strlen(path) - off - 1] = '\0';
+ fprintf(out_stream,"Number of values exceeded for '%s', allowed: %d, actual: %d\n",tmp,defp->def_tag,file_count);
+ }
+ else {
+ fprintf(out_stream,"Number of values exceeded, allowed: %d, actual: %d\n",defp->def_tag,file_count);
+ }
return FALSE;
}
}