/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to plugins.d/password-prompt.c

  • Committer: Teddy Hogeborn
  • Date: 2008-09-06 17:24:58 UTC
  • Revision ID: teddy@fukt.bsnet.se-20080906172458-2x5wlfkn7oqckt1y
* legalnotice.xml: Copy DocBook 4.4-formatted text from
                   <http://www.gnu.org/licenses/gpl-3.0.dbk>.

Show diffs side-by-side

added added

removed removed

Lines of Context:
216
216
      status = EXIT_SUCCESS;
217
217
      /* Make n = data size instead of allocated buffer size */
218
218
      n = (size_t)ret;
 
219
      /* Strip final newline */
 
220
      if(n>0 and buffer[n-1] == '\n'){
 
221
        buffer[n-1] = '\0';     /* not strictly necessary */
 
222
        n--;
 
223
      }
219
224
      size_t written = 0;
220
225
      while(written < n){
221
226
        ret = write(STDOUT_FILENO, buffer + written, n - written);
256
261
    fprintf(stderr, "%s is exiting with status %d\n", argv[0],
257
262
            status);
258
263
  }
 
264
  if(status == EXIT_SUCCESS){
 
265
    fputc('\n', stderr);
 
266
  }
259
267
  
260
268
  return status;
261
269
}