Skip to content

Commit

Permalink
documented that the first argument of igraph_vector_view cannot be nu…
Browse files Browse the repository at this point in the history
…ll. Closes #849
  • Loading branch information
ntamas committed Sep 1, 2015
1 parent d6f2ddb commit eb4e2c6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/vector.pmt
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ int FUNCTION(igraph_vector,init) (TYPE(igraph_vector)* v, int long size) {
* Be sure that you \em don't ever call the destructor (\ref
* igraph_vector_destroy()) on objects created by this constructor.
* \param v Pointer to an uninitialized \type igraph_vector_t object.
* \param data Pointer, the C array.
* \param data Pointer, the C array. It may not be \c NULL.
* \param length The length of the C array.
* \return Pointer to the vector object, the same as the
* \p v parameter, for convenience.
Expand All @@ -158,6 +158,9 @@ const TYPE(igraph_vector)*FUNCTION(igraph_vector,view) (const TYPE(igraph_vector
const BASE *data,
long int length) {
TYPE(igraph_vector) *v2=(TYPE(igraph_vector)*)v;

assert(data != 0);

v2->stor_begin=(BASE*)data;
v2->stor_end=(BASE*)data+length;
v2->end=v2->stor_end;
Expand Down

0 comments on commit eb4e2c6

Please sign in to comment.