<commit_before>#include <stdlib.h>
#include <string.h>
#include <sys/sysctl.h>
#include <mach/mach_init.h>
#include <mach/mach_host.h>
#include <sys/mount.h>

#include "info.h"

#define LEN 20
#define MNT_IGNORE 0

/* Internal Declarations */
static size_t regetmntinfo(struct statfs **mntbufp,
			   long mntsize, const char **vfslist);
static const char **makevfslist(char *fslist);
static int checkvfsname(const char *vfsname, const char **vfslist);
static char *makenetvfslist(void);

static int skipvfs;

/* Get information */
const char *get_os_type(void) {
	char *s, buf[LEN];
	size_t len;
	int mib[2];

	mib[0] = CTL_KERN;
	mib[1] = KERN_OSTYPE;
	s = malloc(LEN);
	len = sizeof(buf);
	
	if (sysctl(mib, 2, &buf, &len, NULL, 0) == -1)
		strncpy(s, "Darwin", len);
	strncpy(s, buf, len);

	return s;
}

const char *get_os_release(void) {
	char *s, buf[LEN];
	size_t len;
	int mib[2];

	mib[0] = CTL_KERN;
	mib[1] = KERN_OSRELEASE;
	s = malloc(LEN);
	len = sizeof(buf);

	if (sysctl(mib, 2, &buf, &len, NULL, 0) == -1)
		strncpy(s, "Unknown", len);
	strncpy(s, buf, len);

	return s;
}

unsigned int get_cpu_num(void) {
	unsigned int num;
	int mib[2];
	size_t len;

	mib[0] = CTL_HW;
	mib[1] = HW_NCPU;
	len = sizeof(num);

	if (sysctl(mib, 2, &num, &len, NULL, 0) == -1 || !len)
		num = 1;

	return num;
}<commit_msg>No need to add ampersand when passing char[]<commit_after>#include <stdlib.h>
#include <string.h>
#include <sys/sysctl.h>
#include <mach/mach_init.h>
#include <mach/mach_host.h>
#include <sys/mount.h>

#include "info.h"

#define LEN 20
#define MNT_IGNORE 0

/* Internal Declarations */
static size_t regetmntinfo(struct statfs **mntbufp,
			   long mntsize, const char **vfslist);
static const char **makevfslist(char *fslist);
static int checkvfsname(const char *vfsname, const char **vfslist);
static char *makenetvfslist(void);

static int skipvfs;

/* Get information */
const char *get_os_type(void) {
	char *s, buf[LEN];
	size_t len;
	int mib[2];

	mib[0] = CTL_KERN;
	mib[1] = KERN_OSTYPE;
	s = malloc(LEN);
	len = sizeof(buf);
	
	if (sysctl(mib, 2, buf, &len, NULL, 0) == -1)
		strncpy(s, "Darwin", len);
	strncpy(s, buf, len);

	return s;
}

const char *get_os_release(void) {
	char *s, buf[LEN];
	size_t len;
	int mib[2];

	mib[0] = CTL_KERN;
	mib[1] = KERN_OSRELEASE;
	s = malloc(LEN);
	len = sizeof(buf);

	if (sysctl(mib, 2, buf, &len, NULL, 0) == -1)
		strncpy(s, "Unknown", len);
	strncpy(s, buf, len);

	return s;
}

unsigned int get_cpu_num(void) {
	unsigned int num;
	int mib[2];
	size_t len;

	mib[0] = CTL_HW;
	mib[1] = HW_NCPU;
	len = sizeof(num);

	if (sysctl(mib, 2, &num, &len, NULL, 0) == -1 || !len)
		num = 1;

	return num;
}
{'fraction_non_alphanumeric': 0.1697196261682243, 'fraction_numerical': 0.01644859813084112, 'mean_word_length': 4.267716535433071, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '848399', 'n_tokens_mistral': 1261, 'n_tokens_neox': 1191, 'n_words': 307}