Skip to content

Commit

Permalink
iterator limit now match malloc in protocol listing, fix Unity-Techno…
Browse files Browse the repository at this point in the history
  • Loading branch information
illwieckz committed Aug 20, 2015
1 parent 2a95a5d commit ad27070
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion qstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -2654,7 +2654,7 @@ void usage(char *msg, char **argv, char *a1)

sorted_types = (server_type **)malloc(sizeof(server_type*) * n_server_types);
type = &types[0];
for (i = 0; type->id != Q_UNKNOWN_TYPE; type++, i++)
for (i = 0; type->id != Q_UNKNOWN_TYPE && i < n_server_types; type++, i++)
{
sorted_types[i] = type;
}
Expand Down

0 comments on commit ad27070

Please sign in to comment.