mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
Do not use rand() to set a BranchList id
Use a simple counting instead, beecause Coverity complains that rand() is not safe, and counting is siimpler anyway.
This commit is contained in:
parent
9b3c28178c
commit
9f40eaee15
@ -32,6 +32,11 @@ docstring const & Branch::branch() const
|
|||||||
return branch_;
|
return branch_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int list_id_generator = 0;
|
||||||
|
|
||||||
|
BranchList::BranchList()
|
||||||
|
: separator_(from_ascii("|")), id_(++list_id_generator) {}
|
||||||
|
|
||||||
|
|
||||||
void Branch::setBranch(docstring const & s)
|
void Branch::setBranch(docstring const & s)
|
||||||
{
|
{
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
|
|
||||||
#include "support/docstring.h"
|
#include "support/docstring.h"
|
||||||
|
|
||||||
#include <cstdlib> // rand()
|
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
|
|
||||||
@ -104,7 +103,7 @@ public:
|
|||||||
typedef List::const_iterator const_iterator;
|
typedef List::const_iterator const_iterator;
|
||||||
|
|
||||||
///
|
///
|
||||||
BranchList() : separator_(from_ascii("|")), id_(rand()) {}
|
BranchList();
|
||||||
|
|
||||||
///
|
///
|
||||||
docstring separator() const { return separator_; }
|
docstring separator() const { return separator_; }
|
||||||
|
Loading…
Reference in New Issue
Block a user