PARA_INFO_LOG("dumping alsa configuration\n");
snd_pcm_dump(pad->handle, output_log);
PARA_INFO_LOG("dumping alsa configuration\n");
snd_pcm_dump(pad->handle, output_log);
- snd_output_buffer_string(output_log, &buf);
- for (;;) {
- char *p = strchr(buf, '\n');
- if (!p) /* omit last output line, it's empty */
+ sz = snd_output_buffer_string(output_log, &buf);
+ for (p = buf; p < buf + sz;) {
+ char *q = memchr(p, '\n', buf + sz - p);
+ if (!q)
w->post_select = alsa_write_post_select;
w->parse_config_or_die = alsa_parse_config_or_die;
w->free_config = alsa_free_config;
w->post_select = alsa_write_post_select;
w->parse_config_or_die = alsa_parse_config_or_die;
w->free_config = alsa_free_config;
- w->help = (struct ggo_help) {
- .short_help = alsa_write_args_info_help,
- .detailed_help = alsa_write_args_info_detailed_help
- };
+ w->help = (struct ggo_help)DEFINE_GGO_HELP(alsa_write);