Skip to content

Instantly share code, notes, and snippets.

View dheater's full-sized avatar

Daniel Heater dheater

  • Imprivata
  • United States
View GitHub Profile
@dheater
dheater / RespiraWorks-CLA
Last active February 28, 2021 20:28
RespiraWorks CLA
RespiraWorks Individual Contributor License Agreement
=====================================================
Thank you for your interest in contributing to RespiraWorks ("We" or "Us").
This contributor agreement ("Agreement") documents the rights granted by contributors to Us. To make this document effective, please sign it and send it to Us by electronic submission, following the instructions at https://respiraworks.github.io/Ventilator/contributing/contributing.html. This is a legally binding document, so please read it carefully before agreeing to it. The Agreement may cover more than one software project managed by Us.
1. Definitions
______________
@dheater
dheater / srtlncpy.c
Last active March 17, 2019 19:43
Safer version of strcpy/strncpy/strlcpy
#include "strlncpy.h"
size_t strlncpy(char *dst, const char *src, size_t dbytes, size_t sbytes)
{
char *d = dst;
const char *s = src;
size_t n = (dbytes > sbytes) ? sbytes : dbytes;
/* Copy as many bytes as will fit */
while(n-- > 0) {