From 5a987f258dc9e5e68be065dfd1067d6c8a868a2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Thu, 29 Nov 2012 12:49:29 +0100 Subject: [PATCH] Feature #1611: Instead of changing negative limits to 0, report the error --- include/Quota.h | 2 +- src/um/Quota.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/Quota.h b/include/Quota.h index 756fe903d1..bf00b18049 100644 --- a/include/Quota.h +++ b/include/Quota.h @@ -182,7 +182,7 @@ private: * @param va limits for the new quota if 0 limits will be 0 * @param default_allowed whether or not the limit -1 is allowed * - * @return a new attribute representing the quota + * @return a new attribute representing the quota, 0 on error */ VectorAttribute * new_quota(VectorAttribute* va, bool default_allowed); diff --git a/src/um/Quota.cc b/src/um/Quota.cc index 74a2b95739..5ba6d55d83 100644 --- a/src/um/Quota.cc +++ b/src/um/Quota.cc @@ -413,7 +413,7 @@ VectorAttribute * Quota::new_quota(VectorAttribute * va, bool default_allowed) if ( (default_allowed && limit_i < -1) || (!default_allowed && limit_i < 0) ) { - limit = "0"; + return 0; } limits.insert(make_pair(metrics[i], limit));