MCPcopy Create free account
hub / github.com/ElementsProject/lightning / getline_stdin_pass

Function getline_stdin_pass

common/hsm_encryption.c:104–113  ·  view source on GitHub ↗

Read a line from stdin, do not take the newline character into account. */

Source from the content-addressed store, hash-verified

102
103/* Read a line from stdin, do not take the newline character into account. */
104static bool getline_stdin_pass(char **passwd, size_t *passwd_size)
105{
106 if (getline(passwd, passwd_size, stdin) < 0)
107 return false;
108
109 if ((*passwd)[strlen(*passwd) - 1] == '\n')
110 (*passwd)[strlen(*passwd) - 1] = '\0';
111
112 return true;
113}
114
115char *read_stdin_pass_with_exit_code(char **reason, int *exit_code)
116{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected