summaryrefslogtreecommitdiff
path: root/examples/network/common.c
Commit message (Collapse)AuthorAgeFilesLines
* examples: merge common network codePatrick Steinhardt2019-02-151-85/+0
| | | | | | | | | | | | Right now, we have two sets of "common" code, one containing general common code and one containing network common code. As we intend to get rid of the network subdirectory and instead merge all examples into a single standalone executable, this distinction doesn't make a lot of sense now. Furthermore, the common network code is not that big. Let's get rid of the common network code by merging it into the general common code.
* examples: network: fix Win32 linking errors due to getlinePatrick Steinhardt2017-11-061-2/+39
| | | | | | | | | | | | The getline(3) function call is not part of ISO C and, most importantly, it is not implemented on Microsoft Windows platforms. As our networking example code makes use of getline, this breaks builds on MSVC and MinGW. As this code wasn't built prior to the previous commit, this was never noticed. Fix the error by instead implementing a `readline` function, which simply reads the password from stdin until it reads a newline character.
* examples: network: refactor credentials callbackPatrick Steinhardt2017-05-151-5/+19
| | | | | | | | The credentials callback reads the username and password via scanf into fixed-length arrays. While these are simply examples and as such not as interesting, the unchecked return value of scanf causes GCC to emit warnings. So while we're busy to shut up GCC, we also fix the possible overflow of scanf by using getline instead.
* Adding credentials callback to ls-remote and fetch too.Krzysztof Adamski2013-09-011-0/+34