functionSource
stringlengths
20
97.4k
CWE-119
bool
2 classes
CWE-120
bool
2 classes
CWE-469
bool
2 classes
CWE-476
bool
2 classes
CWE-other
bool
2 classes
combine
int64
0
1
getInStatementIndentAssign(const string &line, size_t currPos) const { assert(line[currPos] == '='); if (currPos == 0) return 0; // get the last legal word (may be a number) size_t end = line.find_last_not_of(" \t", currPos - 1); if (end == string::npos || !isLegalNameChar(line[end])) return 0; int start; ...
false
false
false
false
false
0
skfp_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { struct s_smc *smc = netdev_priv(dev); skfddi_priv *lp = &smc->os; struct s_skfp_ioctl ioc; int status = 0; if (copy_from_user(&ioc, rq->ifr_data, sizeof(struct s_skfp_ioctl))) return -EFAULT; switch (ioc.cmd) { case SKFP_GET_STATS: /* Get the dr...
false
false
false
false
false
0
f_getown_ex(struct file *filp, unsigned long arg) { struct f_owner_ex __user *owner_p = (void __user *)arg; struct f_owner_ex owner; int ret = 0; read_lock(&filp->f_owner.lock); owner.pid = pid_vnr(filp->f_owner.pid); switch (filp->f_owner.pid_type) { case PIDTYPE_MAX: owner.type = F_OWNER_TID; break; cas...
false
false
false
false
false
0
xmlSecKeyInfoCtxDebugDump(xmlSecKeyInfoCtxPtr keyInfoCtx, FILE* output) { xmlSecAssert(keyInfoCtx != NULL); xmlSecAssert(output != NULL); switch(keyInfoCtx->mode) { case xmlSecKeyInfoModeRead: fprintf(output, "= KEY INFO READ CONTEXT\n"); break; case xmlSecKeyInfoModeWrite: fprintf(output,...
false
false
false
false
false
0
compute_to_tr_(const double dPP, const double dPD, const double dDD, const double dTrustRadius, const bool bConsiderBothRoots, const double dDHD, ...
false
false
false
false
false
0
ui_emodule_uninstall(int k) { emodule *em; int i; if(k < 0 || k >= VVCOUNT(uistate.emod)) return; em = &VVEC(uistate.emod, emodule)[k]; for(i = k+1; i < VVCOUNT(uistate.emod); i++, em++) *em = *(em+1); VVCOUNT(uistate.emod)--; uistate.emod_changed = k+1; }
false
false
false
false
false
0
saa6588_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct saa6588 *s; struct v4l2_subdev *sd; v4l_info(client, "saa6588 found @ 0x%x (%s)\n", client->addr << 1, client->adapter->name); s = devm_kzalloc(&client->dev, sizeof(*s), GFP_KERNEL); if (s == NULL) return -ENOMEM; s->buf...
false
false
false
false
false
0
_fm_folder_event_file_changed(FmFolder *folder, FmPath *path) { gboolean added; G_LOCK(lists); /* make sure that the file is not already queued for changes or * it's already queued for addition. */ if(!g_slist_find(folder->files_to_update, path) && !g_slist_find(folder->files_to_add, path) ...
false
false
false
false
false
0
load_typcache_tupdesc(TypeCacheEntry *typentry) { Relation rel; if (!OidIsValid(typentry->typrelid)) /* should not happen */ elog(ERROR, "invalid typrelid for composite type %u", typentry->type_id); rel = relation_open(typentry->typrelid, AccessShareLock); Assert(rel->rd_rel->reltype == typentry->type_id); ...
false
false
false
false
false
0
bcma_register_devices(struct bcma_bus *bus) { struct bcma_device *core; int err; list_for_each_entry(core, &bus->cores, list) { /* We support that cores ourself */ switch (core->id.id) { case BCMA_CORE_4706_CHIPCOMMON: case BCMA_CORE_CHIPCOMMON: case BCMA_CORE_NS_CHIPCOMMON_B: case BCMA_CORE_PCI: case...
false
false
false
false
false
0
_dxf_cat_hashcmp( Key searchkey, Element element ) { int i; int *a; int *b; char *c; char *d; hashelement *h1 = ( hashelement * ) element; hashelement *h2 = ( hashelement * ) searchkey; int size = h1->cp->intsize; int remainder = h1->cp->remainder; a = h1->p; b = h2->p; ...
false
false
false
false
false
0
rdatasetstats_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) { stats_dumparg_t *dumparg = arg; FILE *fp; char typebuf[64]; const char *typestr; isc_boolean_t nxrrset = ISC_FALSE; isc_boolean_t stale = ISC_FALSE; #ifdef HAVE_LIBXML2 xmlTextWriterPtr writer; int xmlrc; #endif #ifdef HAVE_JSON json_...
true
true
false
false
false
1
Recv(void* buffer, size_t length) { int received = ::recv(s_, static_cast<char*>(buffer), static_cast<int>(length), 0); if ((received == 0) && (length != 0)) { // Note: on graceful shutdown, recv can return 0. In this case, we // pretend it is blocking, and then signal clo...
false
false
false
false
false
0
loadConfig_sensorSpecific( const mrpt::utils::CConfigFileBase &configSource, const std::string &iniSection ) { m_sensorPoseOnRobot.setFromValues( configSource.read_float(iniSection,"pose_x",0), configSource.read_float(iniSection,"pose_y",0), configSource.read_float(iniSection,"pose_z",0), DEG2RAD( configSo...
false
false
false
false
false
0
butWin_turnOnTimers(ButWin *win) { ButTimer *timer; for (timer = but_timerList; timer != NULL; timer = timer->next) { if ((timer->win == win) && (timer->state == butTimer_off) && timer->winOnly) timer->state = butTimer_on; } }
false
false
false
false
false
0
Drealsaverdsfig( FigureRds ) rdsfig_list *FigureRds; { rdsbegin(); DrealActiveExitHandler(); if ( setjmp( DrealJumpBuffer ) == 0 ) { saverdsfig( FigureRds ); DrealResetExitHandler(); rdsend(); return( DREAL_TRUE ); } DrealResetExitHandler(); rdsend(); return( DREAL_FALSE ); }
false
false
false
false
false
0
emitLoadStoreSizeCS(DataType ty) { switch (ty) { case TYPE_U8: break; case TYPE_U16: code[1] |= 0x4000; break; case TYPE_S16: code[1] |= 0x8000; break; case TYPE_F32: case TYPE_S32: case TYPE_U32: code[1] |= 0xc000; break; default: assert(0); break; } }
false
false
false
false
false
0
ASC_PG_App ( const ASCString& themeName ) : fullScreen(false), bitsperpixel(0) { this->themeName = themeName; EnableSymlinks(true); EnableAppIdleCalls(); sigAppIdle.connect( idleEvent ); // I don't get a direct connection to work // sigAppIdle.connect( SigC::slot( &idler )); int i = 0; bool theme...
false
false
false
false
false
0
modssl_init_stapling(server_rec *s, apr_pool_t *p, apr_pool_t *ptemp, modssl_ctx_t *mctx) { SSL_CTX *ctx = mctx->ssl_ctx; SSLModConfigRec *mc = myModConfig(s); if (mc->stapling_cache == NULL) { ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(01958) ...
false
false
false
false
false
0
domainlist_done(struct cl_engine* engine) { if(engine && engine->domainlist_matcher) { regex_list_done(engine->domainlist_matcher); free(engine->domainlist_matcher); } }
false
false
false
false
false
0
udp_check_semi_reliable(const void *head, size_t len) { uint8 flags, part, count; const unsigned char *tag; enum udp_traffic utp; if (len < UDP_RELIABLE_HEADER_SIZE) return UNKNOWN; /* * We're only interested in "GTA" and "GND" traffic. */ tag = head; if (tag[0] != 'G') return UNKNOWN; if ('T' == ta...
false
false
false
false
false
0
FindCertsEmailCallback(CERTCertificate *cert, SECItem *item, void *arg) { FindCertsEmailArg *cbparam = (FindCertsEmailArg *) arg; const char *cert_email = CERT_GetFirstEmailAddress(cert); PRBool found = PR_FALSE; /* Email address present in certificate? */ if (cert_email == NULL){ return SECSucce...
false
false
false
false
false
0
elm_theme_name_available_list_new(void) { Eina_List *list = NULL; Eina_List *dir, *l; char buf[PATH_MAX], *file, *s, *th; static const char *home = NULL; if (!home) { home = getenv("HOME"); if (!home) home = ""; } snprintf(buf, sizeof(buf), "%s/"ELEMENTARY_BASE_DIR"/themes"...
false
false
false
false
false
0
e1000_check_for_link_vf(struct e1000_hw *hw) { struct e1000_mbx_info *mbx = &hw->mbx; struct e1000_mac_info *mac = &hw->mac; s32 ret_val = E1000_SUCCESS; u32 in_msg = 0; /* We only want to run this if there has been a rst asserted. * in this case that could mean a link change, device reset, * or a virtual fun...
false
false
false
false
false
0
pixCreateFromPixcomp(PIXC *pixc) { l_int32 w, h, d, cmapinpix, format; PIX *pix; PROCNAME("pixCreateFromPixcomp"); if (!pixc) return (PIX *)ERROR_PTR("pixc not defined", procName, NULL); if ((pix = pixReadMem(pixc->data, pixc->size)) == NULL) return (PIX *)ERROR_PTR("pix not read", ...
false
false
false
false
false
0
array_buffer_info(arrayobject *self, PyObject *unused) { PyObject* retval = NULL; retval = PyTuple_New(2); if (!retval) return NULL; PyTuple_SET_ITEM(retval, 0, PyLong_FromVoidPtr(self->ob_item)); PyTuple_SET_ITEM(retval, 1, PyLong_FromLong((long)(Py_SIZE(self)))); return retval; }
false
false
false
false
true
1
peer_match(Ssl_conf *conf, char *peer, char **errbuf) { int i, st; Ssl_peer_match **smb; if (conf->peer_match_vec == NULL) return(0); smb = (Ssl_peer_match **) dsvec_base(conf->peer_match_vec); for (i = 0; smb[i] != NULL; i++) { st = regexec(smb[i]->regex, peer, 0, NULL, 0); if (conf->verbose_flag) { ...
true
true
false
false
false
1
STORE_REGFILE(offs_t addr, UINT8 data) /* Write to internal memory */ { if ((picmodel == 0x16C57) || (picmodel == 0x16C58)) { addr |= (R.FSR & 0x60); } if ((addr & 0x10) == 0) addr &= 0x0f; switch(addr) { case 00: addr = (R.FSR & picRAMmask); if (addr == 0) break; if ((addr & 0x10) == 0...
false
false
false
false
false
0
terminal_window_finalize (GObject *object) { TerminalWindow *window = TERMINAL_WINDOW (object); TerminalWindowPrivate *priv = window->priv; g_object_unref (priv->ui_manager); if (priv->confirm_close_dialog) gtk_dialog_response (GTK_DIALOG (priv->confirm_close_dialog), GTK_RESPONSE...
false
false
false
false
false
0
xmlSecTmplKeyInfoAddX509Data(xmlNodePtr keyInfoNode) { xmlNodePtr res; xmlSecAssert2(keyInfoNode != NULL, NULL); res = xmlSecAddChild(keyInfoNode, xmlSecNodeX509Data, xmlSecDSigNs); if(res == NULL) { xmlSecError(XMLSEC_ERRORS_HERE, NULL, "xmlSecAddChild", XMLSEC_ERRORS_R_XM...
false
false
false
false
false
0
globfree(glob_t * pglob) { int i; char **pp; if (pglob->gl_pathv != NULL) { pp = pglob->gl_pathv; for (i = pglob->gl_pathc; i--; ++pp) { free(*pp); } free(pglob->gl_pathv); pglob->gl_pathv = NULL; } }
false
false
false
false
false
0
camel_index_find (CamelIndex *idx, const gchar *word) { CamelIndexClass *class; CamelIndexCursor *ret; gchar *b = (gchar *) word; g_return_val_if_fail (CAMEL_IS_INDEX (idx), NULL); class = CAMEL_INDEX_GET_CLASS (idx); g_return_val_if_fail (class->find != NULL, NULL); if ((idx->state & CAMEL_...
false
false
false
true
false
1
write_dir(struct open_file *ofile, const char *buf, size_t len, off_t offset) { const struct disk_dentry *new_ddent; struct disk_dentry *ddent; struct dentry *dentry; size_t total = 0; TRACE("len=%zu off=%zu\n", len, (size_t)offset); if (len < sizeof(struct disk_dentry)) return -EINVAL; if (len % sizeof(st...
false
true
false
false
false
1
nxrdln (char *cmd, char *prompt) { char *ch, *ch2; ch=readline(gatxtl(prompt,-1)); if ( ch== NULL) { return(-1); } else { ch2 = ch; while (*ch == ' ') ch++; /* Skip leading blanks */ strcpy(cmd, ch); if (*ch) add_history(ch); /* Skip blank lines */ } return(strlen(cmd)+1); }
false
true
false
false
false
1
P_Rotate_Properties (Object w, Object v, Object delta) { Atom *p; register int i, n; Alloca_Begin; Check_Type (w, T_Window); Check_Type (v, T_Vector); n = VECTOR(v)->size; Alloca (p, Atom*, n * sizeof (Atom)); for (i = 0; i < n; i++) { Object a; a = VECTOR(v)->data[i]; ...
false
false
false
false
false
0
add(const QString &filePath) { QFileInfo fi(filePath); QString path = fi.absolutePath(); // watching this path already? DirWatch *dirWatch = 0; foreach(const DirItem &di, dirs) { if(di.dirWatch->dirName() == path) { dirWatch = di.dirWatch; break; } } // if not, make a watcher if(!d...
false
false
false
false
false
0
evcom_buf_new2 (size_t len) { void *data = malloc(sizeof(evcom_buf) + len); if (!data) return NULL; evcom_buf *buf = data; buf->len = len; buf->release = (void (*)(evcom_buf*))free; buf->base = data + sizeof(evcom_buf); return buf; }
false
false
false
false
false
0
RequestData(vtkInformation *, vtkInformationVector **input, vtkInformationVector *output) { vtkDataObject *tmpDataObj; // Get the input. tmpDataObj = input[0]->GetInformationObject(0)->Get( vtkDataObject::DATA_OBJECT()); vtkUnstructuredGrid *usgIn = vtkUnstructuredGrid::SafeDownCast(tmpDataObj); // ...
false
false
false
false
false
0
free_ringbuffer(struct ngene *dev, struct SRingBufferDescriptor *rb) { struct SBufferHeader *Cur = rb->Head; u32 j; if (!Cur) return; for (j = 0; j < rb->NumBuffers; j++, Cur = Cur->Next) { if (Cur->Buffer1) pci_free_consistent(dev->pci_dev, rb->Buffer1Length, Cur->Buffer1, Cur->...
false
false
false
false
false
0
DirectFunctionCall4(PGFunction func, Datum arg1, Datum arg2, Datum arg3, Datum arg4) { FunctionCallInfoData fcinfo; Datum result; InitFunctionCallInfoData(fcinfo, NULL, 4, NULL, NULL); fcinfo.arg[0] = arg1; fcinfo.arg[1] = arg2; fcinfo.arg[2] = arg3; fcinfo.arg[3] = arg4; fcinfo.argnull[0] = false; fci...
false
false
false
false
false
0
hamsi_big_close(sph_hamsi_big_context *sc, unsigned ub, unsigned n, void *dst, size_t out_size_w32) { unsigned char pad[8]; size_t ptr, u; unsigned z; unsigned char *out; ptr = sc->partial_len; #if SPH_64 sph_enc64be(pad, sc->count + (ptr << 3) + n); #else sph_enc32be(pad, sc->count_high); sph_enc32be(pad + 4...
true
true
false
false
false
1
__ecereMethod_GDBDialog_AddCommand(struct __ecereNameSpace__ecere__com__Instance * this, char * string) { struct GDBDialog * __ecerePointer_GDBDialog = (struct GDBDialog *)(this ? (((char *)this) + __ecereClass_GDBDialog->offset) : 0); if(string && strlen(string)) { struct Command * cmd = (cmd = __ecereNameSpace__ecer...
false
false
false
true
false
1
jffs2_verify_write(struct jffs2_sb_info *c, unsigned char *buf, uint32_t ofs) { int ret; size_t retlen; char *eccstr; ret = mtd_read(c->mtd, ofs, c->wbuf_pagesize, &retlen, c->wbuf_verify); if (ret && ret != -EUCLEAN && ret != -EBADMSG) { pr_warn("%s(): Read back of page at %08x failed: %d\n", __fun...
false
false
false
false
false
0
recfield (LexState *ls) { /* recfield -> (NAME | '['exp1']') = exp1 */ switch (ls->t.token) { case TK_NAME: { luaK_kstr(ls, checkname(ls)); break; } case '[': { next(ls); exp1(ls); check(ls, ']'); break; } default: luaK_error(ls, "<name> or `[' expected"); }...
false
false
false
false
false
0
qla8044_idc_unlock(struct qla_hw_data *ha) { int id; scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev); id = qla8044_rd_reg(ha, QLA8044_DRV_LOCK_ID); if ((id & 0xFF) != ha->portnum) { ql_log(ql_log_warn, vha, 0xb118, "%s: IDC Unlock by %d failed, lock owner is %d!\n", __func__, ha->portnum, (id & 0xF...
false
false
false
false
false
0
hide_button() { if( ! m_shown ) return; remove_page( m_vbox ); m_shown = false; }
false
false
false
false
false
0
nvbios_boostSp(struct nvkm_bios *bios, int idx, u16 data, u8 *ver, u8 *hdr, u8 cnt, u8 len, struct nvbios_boostS *info) { data = nvbios_boostSe(bios, idx, data, ver, hdr, cnt, len); memset(info, 0x00, sizeof(*info)); if (data) { info->domain = nvbios_rd08(bios, data + 0x00); info->percent = nvbi...
false
false
false
false
false
0
__vskipto3_any(int32 targ1, int32 targ2, int32 targ3) { if (__iact_state) longjmp(__iact_jmpbuf, 1); for (;;) { if (__toktyp == targ1 || __toktyp == targ2 || __toktyp == targ3) { __syncto_class = SYNC_TARG; return(TRUE); } if (set_syncto_tokclass((byte) __toktyp)) break; if (__toktyp == TEOF) __fte...
false
false
false
false
false
0
attack(int str, int *move) { int result; int nodes; int origin; int the_move = NO_MOVE; int liberties = countlib(str); nodes_when_called = reading_node_counter; /* Don't even spend time looking in the cache if there are more than * enough liberties. We need this before the persistent cache lookup *...
false
false
false
false
false
0
opengl_aabitmap_ex_internal(int x, int y, int w, int h, int sx, int sy, bool resize, bool mirror) { if ( (w < 1) || (h < 1) ) { return; } if ( !gr_screen.current_color.is_alphacolor ) { return; } float u_scale, v_scale; GL_CHECK_FOR_ERRORS("start of aabitmap_ex_internal()"); GL_state.SetTextureSource(TEX...
false
false
false
false
false
0
__ecereMethod___ecereNameSpace__eda__DataSource_Status(struct __ecereNameSpace__ecere__com__Instance * this) { struct __ecereNameSpace__eda__DataSource * __ecerePointer___ecereNameSpace__eda__DataSource = (struct __ecereNameSpace__eda__DataSource *)(this ? (((char *)this) + __ecereClass___ecereNameSpace__eda__DataSourc...
false
false
false
true
false
1
paintOutline(QPainter *p, int _tx, int _ty, int w, int h, const RenderStyle* style) { int ow = style->outlineWidth(); if(!ow) return; const QColor& oc = style->outlineColor(); EBorderStyle os = style->outlineStyle(); int offset = style->outlineOffset(); #ifdef APPLE_CHANGES if (style->outlineS...
false
false
false
false
false
0
delold(void) { U32B pos,oldpos; unsigned i; Fheader *hd; pos=4; for (i=arccnt;i>0;--i) { if (pos>=arcsize) break; if (lseek(arcfile,pos,SEEK_SET)<0) error(1,ERR_SEEK,"delold()"); hd=getheader(); oldpos=pos; pos+=hd->clen+hd->mylen; if (hd->ver==0xff) { dirty=1; ++i; } else { ...
false
false
false
false
false
0
UnloadMap(VMapManager2* vm) { for (loadedSpawnMap::iterator i = iLoadedSpawns.begin(); i != iLoadedSpawns.end(); ++i) { iTreeValues[i->first].setUnloaded(); for (uint32 refCount = 0; refCount < i->second; ++refCount) { vm->releaseModelInstance(iTreeValues[i->f...
false
false
false
false
false
0
add_row_to_bdb(void *arg, int columns, char **values, char **column_names) { DBT key = { 0, }, value = { 0, }; if (columns != 2 || strcmp(column_names[0], "key") || strcmp(column_names[1], "value")) { fprintf(stderr, "Unknown row type\n"); return SQLITE_ABORT; } key.data = values[0]; key.size = strlen(values...
false
false
false
false
false
0
qla82xx_watchdog(scsi_qla_host_t *vha) { uint32_t dev_state, halt_status; struct qla_hw_data *ha = vha->hw; /* don't poll if reset is going on */ if (!ha->flags.nic_core_reset_hdlr_active) { dev_state = qla82xx_rd_32(ha, QLA82XX_CRB_DEV_STATE); if (qla82xx_check_temp(vha)) { set_bit(ISP_UNRECOVERABLE, &vha-...
false
false
false
false
false
0
php_get_log(PHP_VALUE_NODE *result) { value_value_free(result); PHP_SCOPE_ITEM *si = get_scope_item(g_current_scope, "__param_0"); bool rst; if ( !si ) { rst = false; } else { cast_value_dnum(&si->var->value); rst = si->var->value.int_val != 0; } if ( rst ) { CECPacket req(EC_OP_RESET_LOG); CPhPLibCo...
false
false
false
false
false
0
pkix_pl_LdapDefaultClient_RecvCheckComplete( PKIX_PL_LdapDefaultClient *client, PKIX_UInt32 bytesProcessed, PKIX_Boolean *pKeepGoing, void *plContext) { PKIX_Boolean complete = PKIX_FALSE; SECStatus rv = SECFailure; LDAPMessageType messageType = 0; LDAPRes...
false
false
false
false
false
0
PrintSelf(std::ostream & os, Indent indent) const { Superclass::PrintSelf(os, indent); os << indent << "Directory: " << m_Directory << std::endl; os << indent << "SubMatch: " << m_SubMatch << std::endl; os << indent << "NumericSort: " << m_NumericSort << std::endl; os << indent << "RegularExpression: " << m_...
false
false
false
false
false
0
gen_peephole (rtx peep) { int i; /* Look through the patterns that are matched to compute the maximum operand number. */ for (i = 0; i < XVECLEN (peep, 0); i++) walk_insn_part (XVECEXP (peep, 0, i), 1, 0); }
false
false
false
false
false
0
builtin_hash(PyObject *self, PyObject *v) { long x; x = PyObject_Hash(v); if (x == -1) return NULL; return PyInt_FromLong(x); }
false
false
false
false
false
0
restart(const char *mesg) { static int was_here = NO; /* redundant due to restarting flag below */ if(was_here) abort(); was_here = YES; ilog(L_MAIN, "Restarting Server because: %s, memory data limit: %ld", mesg, get_maxrss()); server_reboot(); }
false
false
false
false
false
0
handlePart(std::istream& istr, const MessageHeader& header, PartHandler& handler) { handler.handlePart(header, istr); // Read remaining characters from stream in case // the handler failed to read the complete stream. while (istr.good()) istr.get(); }
false
false
false
false
false
0
get_attrib_id(char *str) { if (str_ident(str, "label")) return Att.label; else if (str_ident(str, "bsub_hint_wt")) return Att.bsub_hint_wt; else if (str_ident(str, "answer")) return Att.answer; else if (str_ident(str, "action")) return Att.action; else if (str_ident(str, "action2")) return...
false
false
false
false
false
0
set_acl(acl_t acl, acl_t dacl, const char *fname) { int failed = 0; if (rflag) failed += walk_dir(acl, dacl, fname); /* set regular acl */ if (acl && acl_set_file(fname, ACL_TYPE_ACCESS, acl) == -1) { fprintf(stderr, _("%s: cannot set access acl on \"%s\": %s\n"), program, fname, strerror(errno)); failed...
false
false
false
false
false
0
boinc_rename_aux(const char* const old, const char* const newf) { #ifdef _WIN32 if (MoveFileExA(old, newf, MOVEFILE_REPLACE_EXISTING|MOVEFILE_WRITE_THROUGH)) return 0; return GetLastError(); #else // rename() doesn't work between filesystems. // So if it fails, try the "mv" command, which does work ...
false
false
false
false
false
0
registerFactory(CAccessorFactoryContainer& outContainer){ outContainer.registerFactory(this, getName()); }
false
false
false
false
false
0
symlink_file (char* old_pathstring, char* new_pathstring) { gcv_object_t *failed = NULL; begin_blocking_system_call(); if (symlink(old_pathstring,new_pathstring) < 0) /* symlink file */ failed = (errno==ENOENT ? &STACK_3 : &STACK_1); end_blocking_system_call(); if (failed) OS_file_error(*failed); }
false
false
false
false
false
0
read_wizkit() { FILE *fp; char *ep, buf[BUFSZ]; struct obj *otmp; boolean bad_items = FALSE, skip = FALSE; if (!wizard || !(fp = fopen_wizkit_file())) return; while (fgets(buf, (int)(sizeof buf), fp)) { ep = index(buf, '\n'); if (skip) { /* in case previous line was too long */ if (ep) skip = FALSE;...
false
false
false
false
false
0
saa711x_g_volatile_ctrl(struct v4l2_ctrl *ctrl) { struct v4l2_subdev *sd = to_sd(ctrl); struct saa711x_state *state = to_state(sd); switch (ctrl->id) { case V4L2_CID_CHROMA_AGC: /* chroma gain cluster */ if (state->agc->val) state->gain->val = saa711x_read(sd, R_0F_CHROMA_GAIN_CNTL) & 0x7f; break; } ...
false
false
false
false
false
0
shepherd_write_processor_set_number_file(int proc_set) { bool ret = true; const char *const filename = "processor_set_number"; FILE *fp = NULL; fp = fopen(filename, "w"); if (fp != NULL) { FPRINTF((fp, "%d\n", proc_set)); FCLOSE(fp); } else { shepherd_error(1, MSG_FILE_NOOPEN_SS, fi...
false
false
false
false
true
1
mailmbox_open(struct mailmbox_folder * folder) { int fd; int read_only; fd = -1; read_only = TRUE; if (!folder->mb_read_only) { read_only = FALSE; fd = open(folder->mb_filename, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); } if (folder->mb_read_only || (fd < 0)) { read_only = TRUE; fd = open(f...
false
false
false
false
true
1
addCDS(uint cd_start, uint cd_end, char phase) { if (cd_start>=this->start) { this->CDstart=cd_start; if (strand=='+') this->CDphase=phase; } else this->CDstart=this->start; if (cd_end<=this->end) { this->CDend=cd_end; if (strand=='-') this->CDphase=phase; } else...
false
false
false
false
false
0
CreateAggregateTestRenderer(const ParamSet &params, const vector<Reference<Primitive> > &primitives) { int niters = params.FindOneInt("niters", 100000); return new AggregateTest(niters, primitives); }
false
false
false
false
false
0
beginsWith(string const &s1, string const &s2) const { int const limit = s2.size(), constraint = s1.size(); if(constraint < limit) { return false; } for(int i = 0; i != limit; i++) { if(s1[i] != s2[i]) { return false; } } return true; }
false
false
false
false
false
0
rev_list_view_cell_data_date_func (GtkCellLayout *layout, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { GiggleRevision *revision; gchar *format; gchar buf[256]; const struct tm *tm; gtk...
false
false
false
false
false
0
PressKey(gn_key_code key, int d, struct gn_statemachine *state) { gn_data data; gn_error error; gn_data_clear(&data); data.key_code = key; if ((error = PressOrReleaseKey(true, &data, state))) return error; if (d) usleep(d*1000); if ((error = PressOrReleaseKey(false, &data, state))) return error; return GN_E...
false
false
false
false
true
1
ll_xdl_merge(const struct ll_merge_driver *drv_unused, mmbuffer_t *result, const char *path, mmfile_t *orig, mmfile_t *src1, const char *name1, mmfile_t *src2, const char *name2, int flag, int marker_size) { xmparam_t xmp; int style = 0; int favor = (flag >> 1) & 03; if (buffer_is_binary(orig->pt...
false
false
false
false
false
0
normalFlowLayoutInlineReplaced(pLayout, pBox, pNode, pY, pContext, pNormal) LayoutContext *pLayout; BoxContext *pBox; HtmlNode *pNode; int *pY; InlineContext *pContext; NormalFlow *pNormal; { BoxContext sBox; HtmlCanvas canvas; int w, h; int iOffset = 0; MarginProperties mar...
false
false
false
false
false
0
init_entropy_decoder(APEContext * ctx) { /* Read the CRC */ ctx->CRC = bytestream_get_be32(&ctx->ptr); /* Read the frame flags if they exist */ ctx->frameflags = 0; if ((ctx->fileversion > 3820) && (ctx->CRC & 0x80000000)) { ctx->CRC &= ~0x80000000; ctx->frameflags = bytestream_get...
false
false
false
false
false
0
errorfb (lua_State *L) { int level = 1; /* skip level 0 (it's this function) */ int firstpart = 1; /* still before eventual `...' */ lua_Debug ar; if (lua_gettop(L) == 0) lua_pushliteral(L, ""); else if (!lua_isstring(L, 1)) return 1; /* no string message */ else lua_pushliteral(L, "\n"); lua_pushl...
false
false
false
false
false
0
varnish_delete(struct varnish *v) { CHECK_OBJ_NOTNULL(v, VARNISH_MAGIC); vtc_logclose(v->vl); free(v->name); free(v->workdir); if (v->vd != NULL) VSM_Delete(v->vd); /* * We do not delete the workdir, it may contain stuff people * want (coredumps, shmlog/stats etc), and trying to divine * "may want" is j...
true
true
false
true
true
1
reindex () { makeThisCurrent(); std::map<String,Column*>::iterator ci(m_column.begin()); std::map<String,Column*>::iterator ciEnd(m_column.end()); int status(0); while (ci != ciEnd) { int colnum(0); char* cname = const_cast<char*>((*ci)....
false
false
false
false
false
0
renameExpr (expr, func) chain_list *expr; char *(*func) (); { if (ATOM (expr)) expr->DATA = (void *) (*func) (VALUE_ATOM (expr)); else { while ((expr = CDR (expr))) { renameExpr (CAR (expr), func); } } }
false
false
false
false
false
0
pointee_is_readonly (tree pointee) { while (POINTER_TYPE_P (pointee)) pointee = TREE_TYPE (pointee); return TYPE_READONLY (pointee); }
false
false
false
false
false
0
exfat_error(const char* format, ...) { va_list ap, aq; exfat_errors++; va_start(ap, format); va_copy(aq, ap); fflush(stdout); fputs("ERROR: ", stderr); vfprintf(stderr, format, ap); va_end(ap); fputs(".\n", stderr); if (!isatty(STDERR_FILENO)) vsyslog(LOG_ERR, format, aq); va_end(aq); }
false
false
false
false
true
1
LI47__T1DEFINE_STRUCTURE__cmptop(V693) object V693; { VMB46 VMS46 VMV46 goto TTL; TTL:; V694= (*(LnkLI319))(Cnil,Cnil); V695= make_cons(((/* INLINE-ARGS */V694)==Cnil?Ct:Cnil),Cnil); V696= append((V693),/* INLINE-ARGS */V695); V697= make_cons(((object)VV[257]),/* INLINE-ARGS */V696); (void)((*(LnkLI319))(Ct,/* ...
false
false
false
false
false
0
mcxDPhash ( const void *key , u32 len ) { u32 h0 = 0x12a3fe2du , h1 = 0x37abe8f9u ; const char* k = key ; while (len--) { u32 h = h1 + (h0 ^ (*k++ * 71523)) ; h1 = h0 ; h0 = h ; } return h0 ; }
false
false
false
false
false
0
SystemInformationStripLeadingSpace(kwsys_stl::string& str) { // Because some manufacturers have leading white space - we have to post-process the name. kwsys_stl::string::size_type pos = str.find_first_not_of(" "); if(pos != kwsys_stl::string::npos) { str = str.substr(pos); } }
false
false
false
false
false
0
DoText(CDXReader& cdxr) { CDXTag tag; string text; while(tag=cdxr.ReadNext()) { stringstream& ss = cdxr.data(); switch(tag) { case kCDXProp_Text: UINT16 nStyleRuns; READ_INT16(ss,nStyleRuns); ss.ignore(nStyleRuns*10); ss >> text; default: if(tag & kCDXTag_Object...
false
false
false
false
false
0
update_remote(unsigned char *sha1, struct remote_lock *lock) { struct active_request_slot *slot; struct slot_results results; char *if_header; struct buffer out_buffer = { STRBUF_INIT, 0 }; struct curl_slist *dav_headers = NULL; if_header = xmalloc(strlen(lock->token) + 25); sprintf(if_header, "If: (<opaquelock...
false
false
false
false
false
0
recursive_check_privacy(struct mailprivacy * privacy, mailmessage * msg, struct mailmime * mime) { int r; clistiter * cur; struct mailmime * alternative; int res; struct mailmime * multipart; if (privacy == NULL) return MAIL_NO_ERROR; if (mime_is_registered(privacy, mime)) return MAI...
false
false
false
false
false
0
clear_reg_alias_info (reg) rtx reg; { unsigned int regno = REGNO (reg); if (regno >= FIRST_PSEUDO_REGISTER) { regno -= FIRST_PSEUDO_REGISTER; if (regno < reg_known_value_size) { reg_known_value[regno] = reg; reg_known_equiv_p[regno] = false; } } }
false
false
false
false
false
0
fl_set_form_size( FL_FORM * form, FL_Coord w, FL_Coord h ) { if ( ! form ) { M_err( "fl_set_form_size", "NULL form" ); return; } if ( w != form->w || h != form->h ) fl_scale_form( form, w / form->w_hr, h / form->h_hr ); }
false
false
false
false
false
0
haswell_init_clock_gating(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; ilk_init_lp_watermarks(dev); /* L3 caching of data atomics doesn't work -- disable it. */ I915_WRITE(HSW_SCRATCH1, HSW_SCRATCH1_L3_DATA_ATOMICS_DISABLE); I915_WRITE(HSW_ROW_CHICKEN3, _MASKED_BIT_ENABLE(...
false
false
false
false
false
0
HandleDuelCancelledOpcode(WorldPacket& recvPacket) { DEBUG_LOG("WORLD: Received opcode CMSG_DUEL_CANCELLED"); // no duel requested if (!GetPlayer()->duel) return; // player surrendered in a duel using /forfeit if (GetPlayer()->duel->startTime != 0) { GetPlayer()->CombatStopWith...
false
false
false
false
false
0
sendto (sockAddr& sa, const void* buf, int len, int msgf) // upon error, write throws the number of bytes writen so far instead // of sockerr. { if (rep->stmo != -1 && is_writeready (rep->stmo)==0) throw sockerr (ETIMEDOUT, "sockbuf::sendto", sockname.text.c_str()); int wlen=0; while(len>0) { int wval = ...
false
false
false
false
false
0
playHere() { switch(type) { case INT_WAVE: sine_beep(Device,Pitch,Duration); break; case PLAIN_BEEP: printf("%c",7); fflush(stdout); break; default: play(); } }
false
false
false
false
false
0
compareComplexAffix(const UnicodeString& affixPat, const UnicodeString& text, int32_t pos, int8_t type, UChar* currency) const { int32_t start =...
false
false
false
false
false
0
show_date(unsigned long time, int tz, enum date_mode mode) { struct tm *tm; static char timebuf[200]; if (mode == DATE_RAW) { snprintf(timebuf, sizeof(timebuf), "%lu %+05d", time, tz); return timebuf; } if (mode == DATE_RELATIVE) { struct timeval now; gettimeofday(&now, NULL); return show_date_relative...
false
false
false
false
false
0