copy up to maxlen-1 characters; 'dest' must be able to hold maxlen; treat comma as alternate end of 'src' */
| 1861 | /* copy up to maxlen-1 characters; 'dest' must be able to hold maxlen; |
| 1862 | treat comma as alternate end of 'src' */ |
| 1863 | void |
| 1864 | get_soundlib_name(char *dest, int maxlen) |
| 1865 | { |
| 1866 | int count, idx; |
| 1867 | const char *src; |
| 1868 | |
| 1869 | idx = ga.active_soundlib; |
| 1870 | if (!IndexOk(idx, soundlib_choices)) |
| 1871 | panic("get_soundlib_name: invalid active_soundlib (%d)", idx); |
| 1872 | |
| 1873 | src = soundlib_choices[idx].sndprocs->soundname; |
| 1874 | for (count = 1; count < maxlen; count++) { |
| 1875 | if (*src == ',' || *src == '\0') |
| 1876 | break; /*exit on \0 terminator*/ |
| 1877 | *dest++ = *src++; |
| 1878 | } |
| 1879 | *dest = '\0'; |
| 1880 | } |
| 1881 | |
| 1882 | enum soundlib_ids |
| 1883 | soundlib_id_from_opt(char *op) |
no test coverage detected