diff options
author | David Phillips <david@sighup.nz> | 2016-12-14 15:18:21 +1300 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2016-12-14 15:18:21 +1300 |
commit | 627031d3c296c05b5d49f37622f011c9bc8ca0bf (patch) | |
tree | c13c2731bb24bb2b2a9ad70f14066f65fa8d9040 | |
parent | a5d03ca5ffab3a5ba57f4ff04a7d0dd139c08856 (diff) | |
parent | f9c0169901b31e82e12ace126753fdd6b1511f39 (diff) | |
download | paramano-627031d3c296c05b5d49f37622f011c9bc8ca0bf.tar.xz |
Merge remote-tracking branch 'cnfn/master'0.71
-rw-r--r-- | getgov.c | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -24,15 +24,10 @@ void gg_init() memset(gov_string, '\0', sizeof(gov_string) ); gg_available(i, gov_string, sizeof(gov_string) ); - char* curr = gov_string; - char* end_of_curr = g_strstr_len(curr, strlen(curr), " "); - while (end_of_curr) - { + char** list = g_strsplit(g_strstrip(gov_string), " ", -1); + for (char** name = list; *name; ++name) { memset(governors[i][total_governors], '\0', 13); /* FIXME magic */ - memmove(governors[i][total_governors], curr, end_of_curr - curr); - - curr = end_of_curr+1; - end_of_curr = g_strstr_len(curr, strlen(curr), " "); + memmove(governors[i][total_governors], *name, strlen(*name)); total_governors++; } } |