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
create_pipe_files(struct file **res, int flags) { int err; struct inode *inode = get_pipe_inode(); struct file *f; struct path path; static struct qstr name = { .name = "" }; if (!inode) return -ENFILE; err = -ENOMEM; path.dentry = d_alloc_pseudo(pipe_mnt->mnt_sb, &name); if (!path.dentry) goto err_inode...
false
false
false
false
false
0
ispell_lookup (ichar_t *s, int dotree) { register struct dent * dp; register char * s1; char schar[INPUTWORDLEN + MAXAFFIXLEN]; dp = &m_hashtbl[hash (s, m_hashsize)]; if (ichartostr (schar, s, sizeof schar, 1)) fprintf (stderr, WORD_TOO_LONG (schar)); for ( ; dp != NULL; dp = dp->next) ...
false
false
false
false
false
0
compare_array (gpointer a, gpointer b) { GArray *array_a = (GArray *) a; GArray *array_b = (GArray *) b; int i; for (i = 0; i < MAX_COMPOSE_LEN; i++) { const gchar *data_a = g_array_index (array_a, const gchar *, i); const gchar *data_b = g_array_index (array_b, const gchar *, i); ...
false
false
false
false
false
0
FreePixmap(ListTreeWidget w, Pixinfo * pix) #else static void FreePixmap(w, pix) ListTreeWidget w; Pixinfo * pix; #endif { if (pix->pix) XFreePixmap(XtDisplay((Widget) w), pix->pix); }
false
false
false
false
false
0
fl_finish( void ) { /* Make sure the connection is alive */ if ( ! flx->display ) return; XChangeKeyboardControl( flx->display, fli_keybdmask, &fli_keybdcontrol ); fl_remove_all_signal_callbacks( ); fl_remove_all_timeouts( ); /* Get rid of all forms, first...
false
false
false
false
false
0
max_wt_in_clist(Clist l) { int max = INT_MIN; Clist_pos p; for (p = l->first; p != NULL; p = p->next) if (p->c->weight > max) max = p->c->weight; return max; }
false
false
false
false
false
0
go_daemon() { daemon_pid = fork(); if (daemon_pid == -1) fatal("fork: %s", strerror(errno)); if (daemon_pid) { if (o_wait) exit(wait_for_child()); exit(0); } if (setsid() == -1) fatal("setsid: %s", strerror(errno)); if (!o_wait) reopen_all(); }
false
false
false
false
false
0
vmci_ctx_supports_host_qp(struct vmci_ctx *context) { return context && context->user_version >= VMCI_VERSION_HOSTQP; }
false
false
false
false
false
0
remove_direntries(BDRVVVFATState* s, int dir_index, int count) { int ret = array_remove_slice(&(s->directory), dir_index, count); if (ret) return ret; adjust_dirindices(s, dir_index, -count); return 0; }
false
false
false
false
false
0
loader_AF_load(const char *filename, unsigned char *data, long size, fileio_prop_t **prop) { int olen; unsigned char *ptr; fileio_prop_t *tmp, *prop_ptr, *prop_lptr; ptr = data; prop_ptr = 0; prop_lptr = 0; while (size > 0) { /* * ignore trai...
false
false
false
false
false
0
renderHTMLContentItem(STD_NAMESPACE ostream &docStream, STD_NAMESPACE ostream & /*annexStream*/, const size_t /*nestingLevel*/, size_t & /*annexNumber*/, ...
false
false
false
false
false
0
print_rate(u_int32_t period) { unsigned int i; for (i = 1; i < sizeof(g_rates)/sizeof(struct rates); i++) if (period > g_rates[i].mult || g_rates[i].mult/period < g_rates[i].mult%period) break; printf("%u/%s ", g_rates[i-1].mult / period, g_rates[i-1].name); }
false
false
false
false
false
0
hts221_parse_temp_caldata(struct hts221_hw *hw) { int err, *slope, *b_gen; s16 cal_x0, cal_x1, cal_y0, cal_y1; u8 cal0, cal1; err = hw->tf->read(hw->dev, HTS221_REG_0T_CAL_Y_H, sizeof(cal0), &cal0); if (err < 0) return err; err = hw->tf->read(hw->dev, HTS221_REG_T1_T0_CAL_Y_H, sizeof(cal1), &cal1)...
false
false
false
false
false
0
Cudd_addBddPattern( DdManager * dd, DdNode * f) { DdNode *res; do { dd->reordered = 0; res = cuddAddBddDoPattern(dd, f); } while (dd->reordered == 1); return(res); }
false
false
false
false
false
0
shockwave_load(char *s_name, bool shock_3D) { size_t i; int s_index = -1; shockwave_info *si = NULL; Assert( s_name ); // make sure that this is, or should be, valid if ( !VALID_FNAME(s_name) ) return -1; for (i = 0; i < Shockwave_info.size(); i++) { if ( !stricmp(Shockwave_info[i].filename, s_name) ) { ...
false
false
false
false
false
0
snd_card_asihpi_isr(struct hpi_adapter *a) { struct snd_card_asihpi *asihpi; WARN_ON(!a || !a->snd_card || !a->snd_card->private_data); asihpi = (struct snd_card_asihpi *)a->snd_card->private_data; tasklet_schedule(&asihpi->t); }
false
false
false
false
false
0
clearMonitor(ParseTree const *var, std::string const &type) { std::string const &name = var->name(); if (var->parameters().empty()) { /* Requesting the whole node */ console->clearMonitor(name, Range(), type); } else { /* Requesting subset of a multivariate node */ console->clearMonitor(name, getRan...
false
false
false
false
false
0
writeCoordinates(int& dim, int& coordsys, int *mapping, int& symmetry, double *start, double *end1, double* end2) { int i; fstream& str = modelDataFileStream[COORDINATES]; str << dim << ' ' << coordsys << ' '; for(i = 0; i < 3; ++i) { str << mapping[i] << ' '; } str << std::end...
false
false
false
false
false
0
pricedb_foreach_pricelist(gpointer key, gpointer val, gpointer user_data) { GList *price_list = (GList *) val; GList *node = price_list; GNCPriceDBForeachData *foreach_data = (GNCPriceDBForeachData *) user_data; /* stop traversal when func returns FALSE */ while (foreach_data->ok && node) { ...
false
false
false
false
false
0
get_file(char *string, Url *u) { char *file; if( !string[0] ) return NULL; file = (char*)malloc(strlen(string) + 1); memcpy(file, string, strlen(string) + 1); u->file = file; return string; }
false
true
false
false
false
1
gnm_expr_new_array_elem (int x, int y) { GnmExprArrayElem *ans; ans = CHUNK_ALLOC (GnmExprArrayElem, expression_pool_small); if (ans == NULL) return NULL; ans->oper = GNM_EXPR_OP_ARRAY_ELEM; ans->x = x; ans->y = y; return (GnmExpr *)ans; }
false
false
false
false
false
0
on_got_redirect (BaconVideoWidget *bvw, const char *mrl, TotemObject *totem) { char *new_mrl; if (strstr (mrl, "://") != NULL) { new_mrl = NULL; } else { GFile *old_file, *parent, *new_file; char *old_mrl; /* Get the parent for the current MRL, that's our base */ old_mrl = totem_playlist_get_current_mrl ...
false
false
false
false
false
0
afr_readlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, const char *buf, struct iatt *sbuf, dict_t *xdata) { afr_private_t * priv = NULL; afr_local_t * local = NULL; xlator_t ** ...
false
false
false
false
false
0
auth_totp_token_validate(Auth_token *token, char *otp_value, char *pin, Token_pin_mode pin_mode, unsigned int time_step, int clock_delta, unsigned int drift_window, unsigned int ndigits, unsigned int base, int *driftp) { if (token->mode & TOKEN_MODE_DISABLED) { log_msg((LOG_ERROR_LEVEL, "Token ...
false
false
false
false
false
0
runOnMachineFunction(MachineFunction &MF) { auto &HST = MF.getSubtarget<HexagonSubtarget>(); HII = HST.getInstrInfo(); HRI = HST.getRegisterInfo(); MRI = &MF.getRegInfo(); const HexagonEvaluator HE(*HRI, *MRI, *HII, MF); BitTracker BT(HE, MF); DEBUG(BT.trace(true)); BT.run(); BTP = &BT; std::vector...
false
false
false
false
false
0
get_request(const FXString & url,FXString & output) { FXTRACE((60,"get_request\n")); HttpClient client; if (client.basic("GET",url,"Connection: close\r\n")) { output = client.body(); return true; } else { FXTRACE((60,"get_request failed\n")); set_timeout(); return false; } }
false
false
false
false
false
0
sklearn_lgamma(double x) { /* * Abramowitz and Stegun 6.1.41 * Asymptotic series should be good to at least 11 or 12 figures * For error analysis, see Whittiker and Watson * A Course in Modern Analysis (1927), page 252 */ static const double c[8] = { 1.0/12.0, -1.0/...
false
false
false
false
false
0
triangle(fz_scale_filter *filter, float f) { if (f >= 1) return 0; return 1-f; }
false
false
false
false
false
0
execute( vector< string > & argv, string & out ) { vector<string>::size_type i = 0, vm_no, len = argv.size(); for( ; i < len; i++ ) { vm_no = strtoul( argv[i].c_str(), NULL, 10 ); if( vm_no == 0 && errno == EINVAL || caller->vms.size() <= ...
false
false
false
false
false
0
PostmasterIsAlive(bool amDirectChild) { #ifndef WIN32 if (amDirectChild) { pid_t ppid = getppid(); /* If the postmaster is still our parent, it must be alive. */ if (ppid == PostmasterPid) return true; /* If the init process is our parent, postmaster must be dead. */ if (ppid == 1) return false; ...
false
false
false
false
false
0
sort_neighbors(int *nbr_list, const int nnbrs, const int first, MINUTIAE *minutiae) { double *join_thetas, theta; int i; static double pi2 = M_PI*2.0; /* List of angles of lines joining the current primary to each */ /* of the secondary neighbors. */ ...
false
false
false
false
false
0
victal_check_variable_dec (NODE_T * p) { if (p != NO_NODE) { if (IS (p, VARIABLE_DECLARATION)) { victal_check_variable_dec (SUB (p)); victal_check_variable_dec (NEXT (p)); } else if (is_one_of (p, DEFINING_IDENTIFIER, ASSIGN_SYMBOL, STOP) || IS (p, COMMA_SYMBOL)) { victal_chec...
false
false
false
false
false
0
last_lba(struct block_device *bdev) { if (!bdev || !bdev->bd_inode) return 0; return (bdev->bd_inode->i_size >> 9) - 1ULL; }
false
false
false
false
false
0
debugPosition() const { if (!start().node()) return; //static int context = 5; //RenderObject *r = 0; fprintf(stderr, "Selection =================\n"); if (start() == end()) { Position pos = start(); Position upstream = pos.equivalentUpstreamPosition(); Position d...
false
false
false
false
false
0
GetLiteralDecoder() const { return m_blockType == 1 ? Singleton<HuffmanDecoder, NewFixedLiteralDecoder>().Ref() : m_dynamicLiteralDecoder; }
false
false
false
false
false
0
migemo_set_operator(migemo* object, int index, const unsigned char* op) { if (object) { int retval = rxgen_set_operator(object->rx, index, op); return retval ? 0 : 1; } else return 0; }
false
false
false
false
false
0
consys_conbndval (conbnd_struct *bnd) /* Prints the constraint bound value, as nn*inf+val, or inf+val, or val, depending as the number of infinite contributions is >1, 1, or 0, respectively. As with consys_conbndnme, the routine is robust in the face of a bogus value for bnd.inf. Parameter: bnd: cons...
false
false
false
false
false
0
flushrawdata(void) { // player->putblock((char *)rawdata,rawdataoffset<<1); if (rawdataoffset<<1 == 0) { return -2; } if(local_dest_buffer_size<(rawdataoffset<<1)) return -1; memcpy(local_dest_buffer, rawdata, rawdataoffset<<1); local_dest_buffer+=rawdataoffset<<1; local_dest_buffer_siz...
false
false
false
false
false
0
ruv_tombstone_op (Slapi_PBlock *pb) { char *uniqueid; int rc; slapi_pblock_get (pb, SLAPI_TARGET_UNIQUEID, &uniqueid); rc = uniqueid && strcasecmp (uniqueid, RUV_STORAGE_ENTRY_UNIQUEID) == 0; return rc; }
false
false
false
false
false
0
setMetricsMode(GuiMetricsMode gmm) { Real vpWidth, vpHeight; vpWidth = (Real) (OverlayManager::getSingleton().getViewportWidth()); vpHeight = (Real) (OverlayManager::getSingleton().getViewportHeight()); mViewportAspectCoef = vpHeight/vpWidth; OverlayElement::setMetricsMode(...
false
false
false
false
false
0
LLVMOrcCreateInstance(LLVMTargetMachineRef TM) { TargetMachine *TM2(unwrap(TM)); Triple T(TM2->getTargetTriple()); auto CompileCallbackMgr = OrcCBindingsStack::createCompileCallbackMgr(T); auto IndirectStubsMgrBuilder = OrcCBindingsStack::createIndirectStubsMgrBuilder(T); OrcCBindingsStack *JITStack = ...
false
false
false
false
false
0
gp_playlist_remove_by_name(iTunesDB *itdb, gchar *pl_name) { guint i; guint pl_removed = 0; g_return_val_if_fail (itdb, pl_removed); for (i = 1; i < itdb_playlists_number(itdb); i++) { Playlist *pl = itdb_playlist_by_nr(itdb, i); g_return_val_if_fail (pl, pl_removed); g_return_...
false
false
false
false
false
0
Emit_One_F_N_Tagged(int no, char *str) { int n; char *p = str + strlen(str) - 1; for(p = str + strlen(str) - 1; *p != '/'; p--) ; n = atoi(p+1); *p = '\0'; Inst_Printf("call_c", FAST "Create_Functor_Arity_Tagged(\"%s\",%d)", str, n); Inst_Printf("move_ret", "fn(%d)", no); }
false
false
false
false
false
0
parsecmd(int interact) { int t; tokpushback = 0; doprompt = interact; setprompt_if(doprompt, doprompt); needprompt = 0; t = readtoken(); if (t == TEOF) return NODE_EOF; if (t == TNL) return NULL; tokpushback = 1; return list(1); }
false
false
false
false
false
0
t4_bar2_sge_qregs(struct adapter *adapter, unsigned int qid, enum t4_bar2_qtype qtype, int user, u64 *pbar2_qoffset, unsigned int *pbar2_qid) { unsigned int page_shift, page_size, qpp_shift, qpp_mask; u64 bar2_page_offset, bar2_qoffset; unsigned int bar2_qid, bar2_qid_offset, ...
false
false
false
false
false
0
hw_step ( struct process *process ) { struct hw *hw = container_of ( process, struct hw, process ); int rc; if ( xfer_window ( &hw->xfer ) ) { rc = xfer_deliver_raw ( &hw->xfer, hw_msg, sizeof ( hw_msg ) ); hw_finished ( hw, rc ); } }
false
false
false
false
false
0
dobanner(const int type) { char buffer[512]; FILE *msg; size_t buflen; unsigned int nblines = BANNER_MAXLINES; switch (type) { case 0: if ((msg = fopen(".banner", "r")) == NULL # ifdef WITH_WELCOME_MSG && (msg = fopen("welcome.msg", "r")) == NULL # endif ...
false
false
false
false
false
0
module_init(mod_instance_t mi, char *arg) { module_t mod = mi->mod; roster_publish_t roster_publish; if(mod->init) return 0; roster_publish = (roster_publish_t) calloc(1, sizeof(struct _roster_publish_st)); if( config_get_one(mod->mm->sm->config, "user.template.publish", 0) ) { roster_pub...
false
false
false
false
false
0
cr_entry_build_cost(const struct city *pcity, const void *data) { char bufone[8]; char buftwo[8]; static char buf[32]; int price; int turns; if (city_production_has_flag(pcity, IF_GOLD)) { fc_snprintf(buf, sizeof(buf), "*"); return buf; } price = city_production_buy_gold_cost(pcity); tu...
false
false
false
false
false
0
getDownloadableRides(QList<DeviceStoredRideItem> &rides, bool isJouleGPS, QString &err) { emit updateStatus(tr("Read ride summary...")); if (JOULE_DEBUG) printf("Read ride summary\n"); JoulePacket request(READ_RIDE_SUMMARY); if (!request.write(dev, err)) return false; JoulePacket response = Joule...
false
false
false
false
false
0
OTLookupFree(OTLookup *lookup) { struct lookup_subtable *st, *stnext; free(lookup->lookup_name); FeatureScriptLangListFree(lookup->features); for ( st=lookup->subtables; st!=NULL; st=stnext ) { stnext = st->next; free(st->subtable_name); free(st->suffix); chunkfree(st,sizeof(struct lookup_subtable)...
false
false
false
false
false
0
font_size_changed (GtkAdjustment *adjustment, GucharmapMiniFontSelection *fontsel) { int new_size; new_size = gtk_adjustment_get_value (adjustment); if (new_size != get_font_size (fontsel)) set_font_size (fontsel, new_size); }
false
false
false
false
false
0
leader_of(graph_t * g, node_t * v) { graph_t *clust; node_t *rv; if (ND_ranktype(v) != CLUSTER) { /*assert(v == UF_find(v)); could be leaf, so comment out */ rv = UF_find(v); } else { clust = ND_clust(v); rv = GD_rankleader(clust)[ND_rank(v)]; } return rv; }
false
false
false
false
false
0
bubbleUp(int i, dtNode* node) { int parent = (i-1)/2; // note: (index > 0) means there is a parent while ((i > 0) && (m_heap[parent]->total > node->total)) { m_heap[i] = m_heap[parent]; i = parent; parent = (i-1)/2; } m_heap[i] = node; }
false
false
false
false
false
0
init_mpsub(bgav_stream_t * s) { int line_len; double framerate; char * ptr; bgav_subtitle_reader_context_t * ctx; mpsub_priv_t * priv = calloc(1, sizeof(*priv)); ctx = s->data.subtitle.subreader; ctx->priv = priv; s->timescale = GAVL_TIME_SCALE; while(1) { if(!bgav_input_read_line(ctx->input...
false
false
false
false
false
0
io_end_buffering_out(BOOL free_buffers) { if (msgs2stderr && DEBUG_GTE(IO, 2)) { rprintf(FINFO, "[%s] io_end_buffering_out(IOBUF_%s_BUFS)\n", who_am_i(), free_buffers ? "FREE" : "KEEP"); } io_flush(FULL_FLUSH); if (free_buffers) { free_xbuf(&iobuf.out); free_xbuf(&iobuf.msg); } iobuf.out_fd = -1; }
false
false
false
false
false
0
ipmi_sdr_print_sensor_generic_locator(struct ipmi_intf *intf, struct sdr_record_generic_locator *dev) { char desc[17]; memset(desc, 0, sizeof (desc)); snprintf(desc, (dev->id_code & 0x1f) + 1, "%s", dev->id_string); if (!verbose) { if (csv_output) printf("%s,00h,ns,%d.%d\n", dev->id_code ...
true
true
false
false
false
1
explorer_auto_limit_update_rate(Explorer *self) { /* Automatically determine a good maximum frame rate based on the current * elapsed time, and use limit_update_rate() to limit us to that. * Returns 1 if a frame should not be rendered. * * 'gamma' determines the nonlinearity. At gamma=1 we ramp ...
false
false
false
false
false
0
write_binary_entry(std::ostream& out, entry_t * entry) { write_binary_entry_base(out, entry); write_binary_number(out, entry->_date); write_binary_number(out, entry->_date_eff); write_binary_string(out, entry->code); write_binary_string(out, entry->payee); }
false
false
false
false
false
0
update_call_edge_frequencies (gimple_seq_node first, basic_block bb) { struct cgraph_node *cfun_node = NULL; int bb_freq = 0; gimple_seq_node n; for (n = first; n ; n = n->gsbase.next) if (is_gimple_call (n)) { struct cgraph_edge *e; /* These function calls are expensive enough that we want to...
false
false
false
false
false
0
apply_pragma_weak (tree decl, tree value) { if (value) { value = build_string (IDENTIFIER_LENGTH (value), IDENTIFIER_POINTER (value)); decl_attributes (&decl, build_tree_list (get_identifier ("alias"), build_tree_list (NULL, value)), 0); } if (SUPPORTS_WEAK && DECL_E...
false
false
false
false
false
0
ToTree() const { // clone the current map TreeCompound* cpy = new TreeCompound(); for (std::vector<MapCompoundElement*>::const_iterator i( refmap.begin() ); i != refmap.end(); i++) { TreeValue* cpyvalue = (*i)->ToTree(); if (cpyvalue != NULL) { cpy->Set((*i)->Name(), cpyvalue); } }...
false
false
false
false
false
0
btrfs_listxattr(struct dentry *dentry, char *buffer, size_t size) { struct btrfs_key key, found_key; struct inode *inode = d_inode(dentry); struct btrfs_root *root = BTRFS_I(inode)->root; struct btrfs_path *path; struct extent_buffer *leaf; struct btrfs_dir_item *di; int ret = 0, slot; size_t total_size = 0, si...
false
false
false
false
false
0
r_short(RFILE *p) { short x = -1; unsigned char *buffer; buffer = (unsigned char *) r_string(2, p); if (buffer != NULL) { x = buffer[0]; x |= buffer[1] << 8; /* Sign-extension, in case short greater than 16 bits */ x |= -(x & 0x8000); } return x; }
false
false
false
false
false
0
clearIndexSet( void ) { for( int i = 0; i < this->_pData->getNumExample(); i++ ) { this->_indirectIndices[ i ] = i; this->_rawIndices[ i ] = i; } this->_numExamples = this->_pData->getNumExample(); _nExamplesPerClass.clear(); _nExamplesPerClass = this->_pData->getExamplesPerClass(); ...
false
false
false
false
false
0
main(int argc, char **argv) { Fl_Window *window = new Fl_Window(340,180); Fl_Box *box = new Fl_Box(20,40,300,100,"Hello, World!"); box->box(FL_UP_BOX); box->labelfont(FL_BOLD+FL_ITALIC); box->labelsize(36); box->labeltype(FL_SHADOW_LABEL); window->end(); window->show(argc, argv); return Fl::run(); }
false
false
false
false
false
0
meth_get(struct transaction_t *txn, void *params) { struct meth_params *gparams = (struct meth_params *) params; int r, rights; char *server, *acl; /* Parse the path */ if ((r = gparams->parse_path(txn->req_uri->path, &txn->req_tgt, &txn->error.desc))) return r; /* GET an individual resou...
false
false
false
false
false
0
cp_integer(const char *begin, const char *end, int base, uint64_t *result) { const char *s = begin; if (s < end && *s == '+') s++; if ((base == 0 || base == 16) && s + 1 < end && *s == '0' && (s[1] == 'x' || s[1] == 'X')) { s += 2; base = 16; } else if (base == 0 && *s == '0') base = 8; ...
false
false
false
false
false
0
nm_modem_check_connection_compatible (NMModem *self, NMConnection *connection, GError **error) { nm_log_dbg (LOGD_MB, "in %s", __func__); if (NM_MODEM_GET_CLASS (self)->check_connection_compatible) return NM_MODEM_GET_CLASS (self)->check_c...
false
false
false
false
false
0
jpeg_undifference2(j_decompress_ptr cinfo, int comp_index, JDIFFROW diff_buf, JDIFFROW prev_row, JDIFFROW undiff_buf, JDIMENSION width) { UNDIFFERENCE_2D(PREDICTOR2); (void)cinfo;(void)comp_index;(void)diff_buf;(void)prev_row;(void)undiff_buf;(void)width; }
false
false
false
false
false
0
num_2t(Interp &interp, const RefPtr<Expr> &arg, const RefPtr<Obj> &/*data*/) { Val tmp_self=interp.top_scope()->self(); ostringstream oss; oss << tmp_self.i(); RefPtr<Expr> new_tree(new ValExpr(interp.num_val(tmp_self.i()))); Val new_expr(0, interp.expr_obj()->clone()); new_exp...
false
false
false
false
false
0
amd_ntb_peer_spad_addr(struct ntb_dev *ntb, int idx, phys_addr_t *spad_addr) { struct amd_ntb_dev *ndev = ntb_ndev(ntb); if (idx < 0 || idx >= ndev->spad_count) return -EINVAL; if (spad_addr) *spad_addr = (phys_addr_t)(ndev->self_mmio + AMD_SPAD_OFFSET + ndev->peer_spad + (idx << 2)); return 0; ...
false
false
false
false
false
0
memdup(const char *src, size_t buffer_length) { size_t length; bool add = FALSE; char *buffer; if(buffer_length) length = buffer_length; else if(src) { length = strlen(src); add = TRUE; } else /* no length and a NULL src pointer! */ return strdup(""); buffer = malloc(length+add); ...
false
false
false
false
false
0
switch_prepare_ioctl(struct dm_target *ti, struct block_device **bdev, fmode_t *mode) { struct switch_ctx *sctx = ti->private; unsigned path_nr; path_nr = switch_get_path_nr(sctx, 0); *bdev = sctx->path_list[path_nr].dmdev->bdev; *mode = sctx->path_list[path_nr].dmdev->mode; /* * Only pass ioctls through i...
false
false
false
false
false
0
get_the_cwd() { size_t bs = PATH_STEP; char *buf = malloc(bs); while((buf != NULL) && getcwd(buf, bs) == NULL) { char *buf2; buf2 = realloc(buf, bs+=PATH_STEP); if(buf2 == NULL){ free(buf); buf = NULL; } else debug1("pwd: increased buffer to %lu", (unsigned long)bs); buf = buf2; } return buf; }
false
false
false
false
false
0
printTreeDesc(PhyloTree* phyloTree) { for(int i = 1; i <= numSeqs; i++) { for(int j = 1; j <= numSeqs; j++) { cout << " " << phyloTree->treeDesc[i][j]; } cout << "\n"; } }
false
false
false
false
false
0
get_next_unique_pc_id(unsigned int *next_unique_id) { FILE *pc_in_out; char file_name[FILENAME_MAX]; char str[256]; /* Check that file exists and is not empty. If not, * create it and start unique id numbering from 1 */ pc_in_out = jp_open_home_file(EPN".next_id", "a"); if (pc_in_out==NULL) { ...
true
true
true
false
true
1
nv04_gr_unload_context(struct nv04_gr_chan *chan) { struct nvkm_device *device = chan->gr->base.engine.subdev.device; int i; for (i = 0; i < ARRAY_SIZE(nv04_gr_ctx_regs); i++) chan->nv04[i] = nvkm_rd32(device, nv04_gr_ctx_regs[i]); nvkm_wr32(device, NV04_PGRAPH_CTX_CONTROL, 0x10000000); nvkm_mask(device, NV04_...
false
false
false
false
false
0
starxy_set_xy_array(starxy_t* s, const double* xy) { int i,N; N = starxy_n(s); for (i=0; i<N; i++) { s->x[i] = xy[2*i+0]; s->y[i] = xy[2*i+1]; } }
false
false
false
false
false
0
pop_new_stack_if_no_contents (XlwMenuWidget mw) { if (mw->menu.new_depth > 1) { if (!mw->menu.new_stack [mw->menu.new_depth - 1]->contents) mw->menu.new_depth -= 1; } }
false
false
false
false
false
0
axi_clkgen_v1_mmcm_read(struct axi_clkgen *axi_clkgen, unsigned int reg, unsigned int *val) { reg = axi_clkgen_v1_map_mmcm_reg(reg); if (reg == 0) return -EINVAL; axi_clkgen_read(axi_clkgen, reg, val); return 0; }
false
false
false
false
false
0
onHttpRequestFinished( int id, bool err ) { Q_UNUSED( id ); m_timeoutTimer.stop(); if ( err ) { // QHttp error codes: //NoError, //UnknownError, //HostNotFound, //ConnectionRefused, //UnexpectedClose, //InvalidResponseHeader, //WrongConte...
false
false
false
false
false
0
remove_minimum_gain_per_size_tlg(Tlg *tlg, Galms *galms, Alg_set *alg_set, Qmap_tab *over_size_tab, int count) { LoopDat *lpdat; for (lpdat = tlg->lpdat_head; lpdat != NULL; lpdat = lpdat->next) { if (!remove_minimum_gain_per_size_block(lpdat->bpt, galms, alg_set, ...
false
false
false
false
false
0
connman_inet_check_ipaddress(const char *host) { struct addrinfo hints; struct addrinfo *addr; int result; memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_flags = AI_NUMERICHOST; addr = NULL; result = getaddrinfo(host, NULL, &hints, &addr); if (result == 0) result = addr->ai_family; freeaddrinfo(addr)...
false
false
false
false
false
0
process_find_by_cmdline(const char *proc_path, const char *cmdline) { DIR *dir_proc; pid_t pid; struct dirent *en; char pathname[64], *p_name; if (proc_path == NULL) { proc_path = "/proc"; } dir_proc = opendir(proc_path); if (dir_proc == NULL) { print_error("Open directroy %s failed", proc_path); retu...
false
false
false
false
false
0
make_dl() { Dlist d; d = (Dlist) malloc (sizeof(struct dlist)); if(!d) return NULL; d->flink = d; d->blink = d; d->val = (void *) 0; return d; }
false
false
false
false
false
0
clutter_backend_real_resolution_changed (ClutterBackend *backend) { ClutterBackendPrivate *priv = backend->priv; ClutterMainContext *context; ClutterSettings *settings; gdouble resolution; gint dpi; settings = clutter_settings_get_default (); g_object_get (settings, "font-dpi", &dpi, NULL); if (dpi < ...
false
false
false
false
false
0
deactivate(void) { if (!baseDeactivate()) return; remKeyHandler(&myUpCB); remKeyHandler(&myDownCB); remKeyHandler(&myLeftCB); remKeyHandler(&myRightCB); remKeyHandler(&myStopCB); remKeyHandler(&myResetCB); remKeyHandler(&myModeCB); remKeyHandler(&myGyroCB); remKeyHandler(&myIncDistCB); remKey...
false
false
false
false
false
0
usb_set_usb2_hardware_lpm(struct usb_device *udev, int enable) { struct usb_hcd *hcd = bus_to_hcd(udev->bus); int ret = -EPERM; if (enable && !udev->usb2_hw_lpm_allowed) return 0; if (hcd->driver->set_usb2_hw_lpm) { ret = hcd->driver->set_usb2_hw_lpm(hcd, udev, enable); if (!ret) udev->usb2_hw_lpm_enable...
false
false
false
false
false
0
verifier_inflate_and_check_compat (MonoClass *target, MonoClass *gtd, MonoClass *arg) { MonoClass *tmp; if (!(tmp = inflate_class_one_arg (gtd, arg))) return FALSE; if (mono_class_is_variant_compatible (target, tmp, TRUE)) return TRUE; return FALSE; }
false
false
false
false
false
0
analysis_plot_temp(struct analysis_pak *analysis, struct task_pak *task) { gpointer graph; struct model_pak *model; /* checks */ g_assert(analysis != NULL); g_assert(task != NULL); model = task->locked_model; g_assert(model != NULL); /* load frames? */ if (!analysis->position) if (analysis_load(analysis, model, tas...
false
false
false
false
false
0
totem_pl_parser_add_quicktime (TotemPlParser *parser, GFile *file, GFile *base_file, TotemPlParseData *parse_data, gpointer data) { if (data == NULL || totem_pl_parser_is_quicktime (data, strlen (data)) == NULL) return TOTEM_PL_PARSER_RESULT_UNHANDLED; return totem_pl_parser...
false
false
false
false
false
0
firstStringsInScript(UErrorCode &status) { if (U_FAILURE(status)) { return NULL; } UVector *dest = new UVector(status); if (dest == NULL) { status = U_MEMORY_ALLOCATION_ERROR; return NULL; } dest->setDeleter(uprv_deleteUObject); const UChar *src = HACK_FIRST_CHARS_IN...
false
false
false
false
false
0
hattrie_find_leq (hattrie_t* T, const char* key, size_t len, value_t** dst) { /* create node stack for traceback */ size_t sp = 0; node_ptr bs[NODESTACK_INIT]; /* base stack (will be enough mostly) */ node_ptr *ns = bs; /* generic ptr, could point to new mem */ ns[sp] = T->root; /* ...
false
false
false
false
false
0
HPDF_Page_GRestore (HPDF_Page page) { HPDF_GState new_gstate; HPDF_PageAttr attr; HPDF_STATUS ret = HPDF_Page_CheckState (page, HPDF_GMODE_PAGE_DESCRIPTION); HPDF_PTRACE ((" HPDF_Page_GRestore\n")); if (ret != HPDF_OK) return ret; attr = (HPDF_PageAttr)page->attr; if (!attr->gs...
false
false
false
false
false
0
gm_world_view_remove_page(GtkContainer *container, GtkWidget *page) { GtkNotebook *notebook = GTK_NOTEBOOK(container); if (GTK_CONTAINER_CLASS(gm_world_view_parent_class)->remove) { GTK_CONTAINER_CLASS(gm_world_view_parent_class)->remove(container, page); } if (gtk_notebook_get_n_pages(notebook) == 1) { gtk_n...
false
false
false
false
false
0
go_gnm_component_edit (GOComponent *component) { GOGnmComponent *gognm = GO_GNM_COMPONENT (component); WorkbookView *wv; if (gognm->edited) { gdk_window_raise (gtk_widget_get_parent_window (GTK_WIDGET (wbcg_toplevel (gognm->edited)))); return wbcg_toplevel (gognm->edited); } if (!gognm->wv) { component->asce...
false
false
false
false
false
0
get_bounding_box (GSList const *granges, GnmRange *box) { GSList const *l; GnmSheetRange const *gr; int ext_x, ext_y, max_x, max_y; g_return_if_fail (granges != NULL); g_return_if_fail (box != NULL); max_x = max_y = 0; for (l = granges; l != NULL; l = l->next) { gr = l->data; g_return_if_fail (range_is_sa...
false
false
false
false
false
0
runModal(XAP_Frame * pFrame) { UT_return_if_fail(pFrame); // Build the window's widgets and arrange them m_windowMain = _constructWindow(); UT_return_if_fail(m_windowMain); switch(abiRunModalDialog(GTK_DIALOG(m_windowMain), pFrame, this, GTK_RESPONSE_CANCEL, false)) { case GTK_RESPONSE_APPLY: even...
false
false
false
false
false
0
input_escaped_string(const char* buf,std::string &str,char separator,char quotes) { std::string::size_type i,ii; str=""; /* skip initial separators and blank spaces */ for(i=0;isspace(buf[i]) || buf[i]==separator;i++) {} ii=i; if((quotes) && (buf[i] == quotes)) { const char* e = strchr(buf+ii+1,quotes)...
false
false
false
false
false
0