On Fri, Feb 26, 2010 at 08:12:34AM +0800, Frank Li <lznuaa@xxxxxxxxx> wrote: > + for (i = 0; i < buffer.len; i++) > + if (buffer.buf[i] == '\n' || buffer.buf[i] == '\r') { > + buffer.buf[i] = '\0'; > + buffer.len = i; > + } > + return strbuf_detach(&buffer, NULL); > + > + } else { > + return getpass(prompt); > + } According to Documentation/CodingGuidelines, this would be: for (i = 0; i < buffer.len; i++) if (buffer.buf[i] == '\n' || buffer.buf[i] == '\r') { buffer.buf[i] = '\0'; buffer.len = i; } return strbuf_detach(&buffer, NULL); } else return getpass(prompt);
Attachment:
pgpEV4FgCYWbh.pgp
Description: PGP signature