From: Arvin Schnell Date: Fri, 16 Sep 2011 09:06:17 +0000 (+0200) Subject: - added check X-Git-Tag: v0.1.3~291 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a05e212f0bb747255b2c3b5adf7f53fe467af610;p=thirdparty%2Fsnapper.git - added check --- diff --git a/snapper/Snapshot.cc b/snapper/Snapshot.cc index e42ba77f..a841e4ec 100644 --- a/snapper/Snapshot.cc +++ b/snapper/Snapshot.cc @@ -142,6 +142,11 @@ namespace snapper { unsigned int num; it->substr(snapper->infosDir().length() + 1) >> num; + if (num == 0) + { + y2err("invalid num 0. not adding snapshot"); + continue; + } XmlFile file(*it); const xmlNode* root = file.getRootElement(); @@ -169,10 +174,10 @@ namespace snapper continue; } - getChildValue(node, "description", snapshot.description); - getChildValue(node, "pre_num", snapshot.pre_num); + getChildValue(node, "description", snapshot.description); + getChildValue(node, "cleanup", snapshot.cleanup); const list l = getChildNodes(node, "userdata"); @@ -360,12 +365,12 @@ namespace snapper setChildValue(node, "date", datetime(date, true, true)); - if (!description.empty()) - setChildValue(node, "description", description); - if (type == POST) setChildValue(node, "pre_num", pre_num); + if (!description.empty()) + setChildValue(node, "description", description); + if (!cleanup.empty()) setChildValue(node, "cleanup", cleanup);